Class Feature.Create

  • Enclosing class:
    Feature

    public static class Feature.Create
    extends Object
    • Method Detail

      • binaryFeature

        public static Feature binaryFeature​(String name,
                                            byte[] value)
        Create a new binary feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • stringFeature

        public static Feature stringFeature​(String name,
                                            String value)
        Create a new string feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • byteFeature

        public static Feature byteFeature​(String name,
                                          Byte value)
        Create a new byte feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • shortFeature

        public static Feature shortFeature​(String name,
                                           Short value)
        Create a new short feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • intFeature

        public static Feature intFeature​(String name,
                                         Integer value)
        Create a new int feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • longFeature

        public static Feature longFeature​(String name,
                                          Long value)
        Create a new long feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • floatFeature

        public static Feature floatFeature​(String name,
                                           Float value)
        Create a new float feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • doubleFeature

        public static Feature doubleFeature​(String name,
                                            Double value)
        Create a new double feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • bigIntegerFeature

        public static Feature bigIntegerFeature​(String name,
                                                BigInteger value)
        Create a new bigInteger feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • uuidFeature

        public static Feature uuidFeature​(String name,
                                          UUID value)
        Create a new uuid feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • dateFeature

        public static Feature dateFeature​(String name,
                                          Date value)
        Create a new date feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • bigDecimalFeature

        public static Feature bigDecimalFeature​(String name,
                                                BigDecimal value)
        Create a new BigDecimal feature.
        Parameters:
        name - the name of the new feature
        value - the value for the new feature. null value will throw an exception
        Returns:
        the newly created feature object
      • from

        public static Feature from​(String s)
        Create a feature from a string representation of the feature. The feature has to have the following format
             name:TYPE=value
         
        the :TYPE part may be missing in case the feature type is STRING. The value has to be the string representation of the value that is different for each type.
        Parameters:
        s - the feature as string
        Returns:
        the new object created from the string
      • from

        public static Feature from​(byte[] serialized)
        Create the feature from the binary serialized format. The format is defined in the documentation of the method Feature.serialized().
        Parameters:
        serialized - the serialized format.
        Returns:
        a new feature object.
      • throwBinaryWayTooShort

        public static void throwBinaryWayTooShort​(int len)
      • throwBinaryTooShort

        public static void throwBinaryTooShort​(int len)
      • throwBinaryTooLong

        public static void throwBinaryTooLong​(int len,
                                              int extra)
      • throwBinaryTooLong

        public static void throwBinaryTooLong​(String s)