Class AnnotationConvertUtil
- java.lang.Object
-
- com.github.toolarium.enumeration.configuration.util.AnnotationConvertUtil
-
public final class AnnotationConvertUtil extends java.lang.Object
Annotation convert utility
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EnumConfiguration
convert(EnumConfiguration enumConfigurationAnnotation)
Convert aEnumConfiguration
into aEnumConfiguration
.EnumValueConfiguration
convert(EnumValueConfiguration enumValueConfigurationAnnotation)
Convert aEnumValueConfiguration
into aEnumValueConfiguration
.static AnnotationConvertUtil
getInstance()
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 nameEnumValueConfigurationSizing
parseCardinality(java.lang.String inputCardinality)
Parse the cardinality expressionjava.lang.Integer
parseSizeValue(java.lang.String input)
Parse the size valueEnumValueConfigurationSizing
prepareValueSize(java.lang.String minValue, java.lang.String maxValue)
Prepare value sizejava.lang.String
trimQuotationMarks(java.lang.String input)
Trim quotation marks
-
-
-
Method Detail
-
getInstance
public static AnnotationConvertUtil getInstance()
Get the instance- Returns:
- the instance
-
convert
public EnumConfiguration convert(EnumConfiguration enumConfigurationAnnotation)
Convert aEnumConfiguration
into aEnumConfiguration
.- Parameters:
enumConfigurationAnnotation
- theEnumConfiguration
.- Returns:
- the
EnumConfiguration
.
-
convert
public EnumValueConfiguration convert(EnumValueConfiguration enumValueConfigurationAnnotation)
Convert aEnumValueConfiguration
into aEnumValueConfiguration
.- Parameters:
enumValueConfigurationAnnotation
- theEnumValueConfiguration
.- Returns:
- the
EnumValueConfiguration
.
-
prepareValueSize
public EnumValueConfigurationSizing prepareValueSize(java.lang.String minValue, java.lang.String maxValue)
Prepare value size- Parameters:
minValue
- the min valuemaxValue
- the max value- Returns:
- the preapred value
-
parseCardinality
public EnumValueConfigurationSizing parseCardinality(java.lang.String inputCardinality)
Parse the cardinality expression- Parameters:
inputCardinality
- the cardinality- Returns:
- the parsed cardinality
-
parseSizeValue
public java.lang.Integer parseSizeValue(java.lang.String input)
Parse the size value- Parameters:
input
- the string input, either number or *. In case it's null it will return null- Returns:
- the parsed result
-
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
-
-