Class AnnotationConvertUtil
- java.lang.Object
-
- com.github.toolarium.enumeration.configuration.util.AnnotationConvertUtil
-
public final class AnnotationConvertUtil extends java.lang.ObjectAnnotation convert utility
-
-
Field Summary
Fields Modifier and Type Field Description static java.time.InstantMAX_TIMESTAMPstatic java.lang.StringMAX_TIMESTAMP_STRING
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EnumConfigurationconvert(EnumConfiguration enumConfigurationAnnotation)Convert aEnumConfigurationinto aEnumConfiguration.EnumValueConfigurationconvert(EnumValueConfiguration enumValueConfigurationAnnotation)Convert aEnumValueConfigurationinto aEnumValueConfiguration.<T extends java.lang.Enum<T>>
EnumValueConfigurationgetAnnotationInformation(T e)Read the enumstatic AnnotationConvertUtilgetInstance()Get the instance<T extends javax.lang.model.element.ExecutableElement>
java.lang.StringgetName(T type)Get the name<T extends javax.lang.model.element.AnnotationValue>
java.lang.StringgetValue(T type)Get the namejava.time.InstantparseDate(java.lang.String input)Parse a datejava.lang.StringtrimQuotationMarks(java.lang.String input)Trim quotation marks
-
-
-
Field Detail
-
MAX_TIMESTAMP_STRING
public static final java.lang.String MAX_TIMESTAMP_STRING
- See Also:
- Constant Field Values
-
MAX_TIMESTAMP
public static final java.time.Instant MAX_TIMESTAMP
-
-
Method Detail
-
getInstance
public static AnnotationConvertUtil getInstance()
Get the instance- Returns:
- the instance
-
parseDate
public java.time.Instant parseDate(java.lang.String input)
Parse a date- Parameters:
input- the input date as string- Returns:
- the Instant
-
getAnnotationInformation
public <T extends java.lang.Enum<T>> EnumValueConfiguration getAnnotationInformation(T e) throws java.lang.IllegalArgumentException
Read the enum- Type Parameters:
T- the generic type- Parameters:
e- the enumeration value- Returns:
- the parsed content
- Throws:
java.lang.IllegalArgumentException- In case the annotation could not be resolved
-
convert
public EnumConfiguration convert(EnumConfiguration enumConfigurationAnnotation)
Convert aEnumConfigurationinto aEnumConfiguration.- Parameters:
enumConfigurationAnnotation- theEnumConfiguration.- Returns:
- the
EnumConfiguration.
-
convert
public EnumValueConfiguration convert(EnumValueConfiguration enumValueConfigurationAnnotation)
Convert aEnumValueConfigurationinto aEnumValueConfiguration.- Parameters:
enumValueConfigurationAnnotation- theEnumValueConfiguration.- Returns:
- the
EnumValueConfiguration.
-
getName
public <T extends javax.lang.model.element.ExecutableElement> java.lang.String getName(T type)
Get the name- Type Parameters:
T- the generic type- Parameters:
type- the type- Returns:
- the type as name
-
getValue
public <T extends javax.lang.model.element.AnnotationValue> java.lang.String getValue(T type)
Get the name- Type Parameters:
T- the generic type- Parameters:
type- the type- Returns:
- the type as name
-
trimQuotationMarks
public java.lang.String trimQuotationMarks(java.lang.String input)
Trim quotation marks- Parameters:
input- the input- Returns:
- the trimmed output
-
-