Package javax0.license3j
Class Feature.Create
- java.lang.Object
-
- javax0.license3j.Feature.Create
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Feature
bigDecimalFeature(String name, BigDecimal value)
Create a new BigDecimal feature.static Feature
bigIntegerFeature(String name, BigInteger value)
Create a new bigInteger feature.static Feature
binaryFeature(String name, byte[] value)
Create a new binary feature.static Feature
byteFeature(String name, Byte value)
Create a new byte feature.static Feature
dateFeature(String name, Date value)
Create a new date feature.static Feature
doubleFeature(String name, Double value)
Create a new double feature.static Feature
floatFeature(String name, Float value)
Create a new float feature.static Feature
from(byte[] serialized)
Create the feature from the binary serialized format.static Feature
from(String s)
Create a feature from a string representation of the feature.static Feature
intFeature(String name, Integer value)
Create a new int feature.static Feature
longFeature(String name, Long value)
Create a new long feature.static Feature
shortFeature(String name, Short value)
Create a new short feature.static Feature
stringFeature(String name, String value)
Create a new string feature.static void
throwBinaryTooLong(int len, int extra)
static void
throwBinaryTooLong(String s)
static void
throwBinaryTooShort(int len)
static void
throwBinaryWayTooShort(int len)
static Feature
uuidFeature(String name, UUID value)
Create a new uuid feature.
-
-
-
Method Detail
-
binaryFeature
public static Feature binaryFeature(String name, byte[] value)
Create a new binary feature.- Parameters:
name
- the name of the new featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 featurevalue
- 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 formatname:TYPE=value
the:TYPE
part may be missing in case the feature type isSTRING
. 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 methodFeature.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)
-
-