Class ChapterHandler


public class ChapterHandler extends SupplierChain.Handler<String,String>
This class implements an handler for a Chapter object, and it's used by the SupplierChain class to supply the translatins of a string and to retireve all the key-value pairs, stored in the chpater.
  • Constructor Details

    • ChapterHandler

      public ChapterHandler(Chapter c)
      Creates the handler for the Chapter c.
      Parameters:
      c - The Chapter object to handle.
  • Method Details

    • get

      public String get(String source)
      Description copied from class: SupplierChain.Handler
      Get the value from this handler if it is able to handle the input parameter. Implementation note: the subclass should invoke the super implementation if it can not handle the request
      
       {@literal @}Override
       public O get(I input) {
           if (!canHandle(input)) return super.get(input);
           // handle the request
       }
       
      Overrides:
      get in class SupplierChain.Handler<String,String>
      Parameters:
      source - the input parameter
      Returns:
      the output value or null if the input can not be handled
    • getAll

      protected Stream<String> getAll()
      Description copied from class: SupplierChain.Handler
      Get the stream containing all values that this handler can manage. For example, if this handler manages the translations contained in a dictionary, this method should return a stream for all dictionary entries.
      Overrides:
      getAll in class SupplierChain.Handler<String,String>
      Returns:
      the stream containing all the output values, or Stream.empty() if there's none.