Class ValueSpecifications


  • public class ValueSpecifications
    extends java.lang.Object
    Convenience static methods that operate on or return ValueSpecification elements.
    • Field Detail

      • INTERVAL_VALUE_PARSER

        @CheckForNull
        private static java.util.function.Function<Interval,​java.lang.Object> INTERVAL_VALUE_PARSER
    • Constructor Detail

      • ValueSpecifications

        public ValueSpecifications()
    • Method Detail

      • setIntervalValueParser

        public static void setIntervalValueParser​(@CheckForNull
                                                  java.util.function.Function<Interval,​java.lang.Object> intervalParser)
      • getValueSpecificationValue

        @CheckForNull
        public static java.lang.Object getValueSpecificationValue​(@CheckForNull
                                                                  ValueSpecification valueSpecification)
        Return value of given ValueSpecification
        Parameters:
        valueSpecification - value specification
        Returns:
        value
      • createValueSpecification

        @CheckForNull
        public static ValueSpecification createValueSpecification​(@CheckForNull
                                                                  java.lang.Class<? extends ValueSpecification> valueSpecificationClass,
                                                                  @CheckForNull
                                                                  Type valueType,
                                                                  @CheckForNull
                                                                  java.lang.Object value,
                                                                  ElementsFactory factory,
                                                                  @CheckForNull
                                                                  java.util.Collection<? extends ValueSpecification> reuse)
        Create a new value specification for a given value or returns a suitable from the given specifications to reuse.
        Parameters:
        valueSpecificationClass - meta type of value specification
        value - value value of ValueSpecification
        factory - factory
        reuse - a collection of possible value specifications to reuse
        Returns:
        specification
      • createValueSpecification

        @CheckForNull
        public static ValueSpecification createValueSpecification​(@CheckForNull
                                                                  java.lang.Class<? extends ValueSpecification> valueSpecificationClass,
                                                                  @CheckForNull
                                                                  Type valueType,
                                                                  @CheckForNull
                                                                  java.lang.Object value,
                                                                  ElementsFactory factory,
                                                                  @CheckForNull
                                                                  java.util.Collection<? extends ValueSpecification> reuse,
                                                                  boolean ignoreValuesOfReuse)
        Create a new value specification for a given value or returns a suitable from the given specifications to reuse.
        Parameters:
        valueSpecificationClass - meta type of value specification
        value - value value of ValueSpecification
        factory - factory
        reuse - a collection of possible value specifications to reuse
        ignoreValuesOfReuse - if false, checks is value if reuse candidate is suitable, not only the meta type. If true, checks just a metatype and overwrites the value
        Returns:
        specification
      • getEnumerationLiteral

        @CheckForNull
        public static EnumerationLiteral getEnumerationLiteral​(Enumeration enumeration,
                                                               java.lang.String literalName)
        Gets EnumerationLiteral from Enumeration by name.
        Parameters:
        enumeration - enumeration which literals will be searched.
        literalName - name of the EnumerationLiteral.
        Returns:
        EnumerationLiteral from Enumeration by name.
      • getValueSpecificationClass

        public static java.lang.Class<? extends ValueSpecification> getValueSpecificationClass​(@CheckForNull
                                                                                               Type valueType,
                                                                                               @CheckForNull
                                                                                               java.lang.Object value)
        Return a meta type of ValueSpecification which should be used to store values of given type or value. If valueType is null, value is used to define a meta type of value specification.
        Parameters:
        valueType - value type
        Returns:
        meta type of value specification
      • getValueSpecificationClass

        public static java.lang.Class<? extends ValueSpecification> getValueSpecificationClass​(@CheckForNull
                                                                                               Type valueType)
        Return a meta type of ValueSpecification which should be used to store values of given type
        Parameters:
        valueType - value type
        Returns:
        meta type of value specification
      • isValueSpecificationClassElementValue

        public static boolean isValueSpecificationClassElementValue​(@CheckForNull
                                                                    Type valueType)
        Parameters:
        valueType - value type
        Returns:
        true if ValueSpecification for given type should be ElementValue
      • isDataTypeWithAttribute

        private static boolean isDataTypeWithAttribute​(DataType dataType)
      • getLogger

        private static org.apache.logging.log4j.Logger getLogger()