Class OptionalValuesMap<T>

  • Type Parameters:
    T - the type
    All Implemented Interfaces:
    OptionalValues<T>, java.lang.Iterable<java.lang.CharSequence>

    public class OptionalValuesMap<T>
    extends java.lang.Object
    implements OptionalValues<T>
    Default implementation of OptionalValues.
    Since:
    1.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected OptionalValuesMap​(java.lang.Class<?> type, java.util.Map<java.lang.CharSequence,​?> values)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.util.Optional<T> get​(java.lang.CharSequence name)
      Retrieve a value if it is present.
      int hashCode()  
      java.util.Iterator<java.lang.CharSequence> iterator()  
      java.util.Collection<T> values()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • values

        protected final java.util.Map<java.lang.CharSequence,​?> values
    • Constructor Detail

      • OptionalValuesMap

        protected OptionalValuesMap​(java.lang.Class<?> type,
                                    java.util.Map<java.lang.CharSequence,​?> values)
        Parameters:
        type - The type
        values - The values
    • Method Detail

      • get

        public java.util.Optional<T> get​(java.lang.CharSequence name)
        Description copied from interface: OptionalValues
        Retrieve a value if it is present.
        Specified by:
        get in interface OptionalValues<T>
        Parameters:
        name - The name of the value
        Returns:
        An Optional of the value
      • values

        public java.util.Collection<T> values()
        Specified by:
        values in interface OptionalValues<T>
        Returns:
        The values
      • iterator

        public java.util.Iterator<java.lang.CharSequence> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object