Class WithinSet

java.lang.Object
nz.org.riskscape.engine.types.WithinSet
All Implemented Interfaces:
Type, WrappingType

public class WithinSet extends Object implements WrappingType

Can be one of the given values.

  • Field Details

    • TYPE_CONSTRUCTOR

      public static final ComplexTypeConstructor TYPE_CONSTRUCTOR
    • TYPE_INFORMATION

      public static final TypeInformation TYPE_INFORMATION
    • JOINER

      public static final com.google.common.base.Joiner JOINER
  • Constructor Details

    • WithinSet

      public WithinSet(Type underlyingType, Object... objects)
    • WithinSet

      public WithinSet(Type underlyingType, Collection<?> objects)
  • Method Details

    • coerce

      public Object coerce(Object value)
      Description copied from interface: Type

      Attempt to convert the given value in to one represented by this type.

      Specified by:
      coerce in interface Type
      Parameters:
      value - The value to coerce
      Returns:
      A value that conforms to this type
    • internalType

      public Class<?> internalType()
      Description copied from interface: Type

      The underlying java class used to represent this type.

      Specified by:
      internalType in interface Type
    • allowedString

      public String allowedString()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getAllowed

      public Set<?> getAllowed()
    • getUnderlyingType

      public Type getUnderlyingType()
      Specified by:
      getUnderlyingType in interface WrappingType
      Returns:
      the type that we immediately wrap. Used by Type.getUnwrappedType() to descend through all wrapped Type to find the first unwrapped one.