Class EnumKeyValueConfigurationBinaryObjectParser
- java.lang.Object
-
- com.github.toolarium.enumeration.configuration.util.EnumKeyValueConfigurationBinaryObjectParser
-
public final class EnumKeyValueConfigurationBinaryObjectParser extends java.lang.ObjectParse forIEnumKeyValueConfigurationBinaryObject
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBRACE_ENDBRACE ENDstatic java.lang.StringBRACE_STARTBRACE STARTstatic java.lang.StringSEPARATORSEPARATOR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringformat(IEnumKeyValueConfigurationBinaryObject enumKeyValueConfigurationBinaryObject)Format anIEnumKeyValueConfigurationBinaryObjectinto string representation.static EnumKeyValueConfigurationBinaryObjectParsergetInstance()Get the instancejava.lang.StringmergeDefaultValues(EnumKeyValueConfiguration enumKeyValueConfiguration, java.lang.String inputValue)Merge potential default values to a binary value which was read from a configuration.IEnumKeyValueConfigurationBinaryObjectparse(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 anIEnumKeyValueConfigurationBinaryObjectinto 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
-
-