Class EnumKeyValueConfigurationBinaryObjectParser
- java.lang.Object
-
- com.github.toolarium.enumeration.configuration.util.EnumKeyValueConfigurationBinaryObjectParser
-
public final class EnumKeyValueConfigurationBinaryObjectParser extends java.lang.Object
Parse forIEnumKeyValueConfigurationBinaryObject
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BRACE_END
BRACE ENDstatic java.lang.String
BRACE_START
BRACE STARTstatic java.lang.String
SEPARATOR
SEPARATOR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
format(IEnumKeyValueConfigurationBinaryObject enumKeyValueConfigurationBinaryObject)
Format anIEnumKeyValueConfigurationBinaryObject
into string representation.static EnumKeyValueConfigurationBinaryObjectParser
getInstance()
Get the instancejava.lang.String
mergeDefaultValues(EnumKeyValueConfiguration enumKeyValueConfiguration, java.lang.String inputValue)
Merge potential default values to a binary value which was read from a configuration.IEnumKeyValueConfigurationBinaryObject
parse(java.lang.String input)
Parse a binary content.
-
-
-
Field Detail
-
SEPARATOR
public static final java.lang.String SEPARATOR
SEPARATOR- See Also:
- Constant Field Values
-
BRACE_START
public static final java.lang.String BRACE_START
BRACE START- See Also:
- Constant Field Values
-
BRACE_END
public static final java.lang.String BRACE_END
BRACE END- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static EnumKeyValueConfigurationBinaryObjectParser getInstance()
Get the instance- Returns:
- the instance
-
parse
public IEnumKeyValueConfigurationBinaryObject parse(java.lang.String input) throws java.time.format.DateTimeParseException
Parse a binary content. Format:[name]|[timestamp]|{mime-type}[content base64 encoded].
The name, timestamp (according to RFC 3339), mime-type and the content (base64 encoded content) are optional values. If the name, timestamp or content are present, they must be separated by a pipe character (|). The mime-type can be declared as header of the content. If there is no pipe character it's assumed its the content part. e.g.myfile.txt|2021-03-15T08:59:22.123Z|{text/plain}VGV4dAo=
ormyfile.txt|2021-03-15T08:59:22.123Z|{text/plain}
ormyfile.txt|2021-03-15T08:59:22.123Z|VGV4dAo=
or2021-03-15T08:59:22.123Z|{text/plain}VGV4dAo=
or2021-03-15T08:59:22.123Z|{text/plain}
or2021-03-15T08:59:22.123Z|VGV4dAo=
ormyfile.txt|{text/plain}VGV4dAo=
ormyfile.txt|{text/plain}
ormyfile.txt|VGV4dAo=
or{text/plain}VGV4dAo=
or{text/plain}
orVGV4dAo=
- Parameters:
input
- the input- Returns:
- the parsed object
- Throws:
java.time.format.DateTimeParseException
- In case of an invalid date format
-
format
public java.lang.String format(IEnumKeyValueConfigurationBinaryObject enumKeyValueConfigurationBinaryObject)
Format anIEnumKeyValueConfigurationBinaryObject
into string representation.- Parameters:
enumKeyValueConfigurationBinaryObject
- the object to format- Returns:
- the string representation:
Format:
[name]|[timestamp]|{mime-type}[content base64 encoded].
The name, timestamp (according to RFC 3339), mime-type and the content (base64 encoded content) are optional values. If the name, timestamp or content are present, they must be separated by a pipe character (|). The mime-type can be declared as header of the content. If there is no pipe character it's assumed its the content part. e.g.myfile.txt|2021-03-15T08:59:22.123Z|{text/plain}VGV4dAo=
ormyfile.txt|2021-03-15T08:59:22.123Z|{text/plain}
ormyfile.txt|2021-03-15T08:59:22.123Z|VGV4dAo=
or2021-03-15T08:59:22.123Z|{text/plain}VGV4dAo=
or2021-03-15T08:59:22.123Z|{text/plain}
or2021-03-15T08:59:22.123Z|VGV4dAo=
ormyfile.txt|{text/plain}VGV4dAo=
ormyfile.txt|{text/plain}
ormyfile.txt|VGV4dAo=
or{text/plain}VGV4dAo=
or{text/plain}
orVGV4dAo=
-
mergeDefaultValues
public java.lang.String mergeDefaultValues(EnumKeyValueConfiguration enumKeyValueConfiguration, java.lang.String inputValue)
Merge potential default values to a binary value which was read from a configuration.- Parameters:
enumKeyValueConfiguration
- the enum key value configurationinputValue
- the value- Returns:
- the enhanced value
-
-