Record Class FormatConfiguration
java.lang.Object
java.lang.Record
io.micronaut.serde.FormatConfiguration
- Record Components:
pattern- The format patternshape- The shape to uselocale- The locale to usetimezone- The time zone to uselenient- Whether lenient parsing should be usedradix- The numeric base to use
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumShape values supported by format metadata. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default radix marker.static final FormatConfigurationEmpty format configuration. -
Constructor Summary
ConstructorsConstructorDescriptionFormatConfiguration(@Nullable String pattern, FormatConfiguration.Shape shape, @Nullable String locale, @Nullable String timezone, @Nullable Boolean lenient, int radix) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static @Nullable FormatConfigurationfrom(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) Resolve format configuration from annotation metadata.final inthashCode()Returns a hash code value for this object.@Nullable Booleanlenient()Returns the value of thelenientrecord component.@Nullable Stringlocale()Returns the value of thelocalerecord component.@Nullable Locale@Nullable Stringpattern()Returns the value of thepatternrecord component.intradix()Returns the value of theradixrecord component.shape()Returns the value of theshaperecord component.@Nullable Stringtimezone()Returns the value of thetimezonerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_RADIX
public static final int DEFAULT_RADIXThe default radix marker.- See Also:
-
EMPTY
Empty format configuration.
-
-
Constructor Details
-
FormatConfiguration
public FormatConfiguration(@Nullable String pattern, FormatConfiguration.Shape shape, @Nullable String locale, @Nullable String timezone, @Nullable Boolean lenient, int radix) Default constructor.
-
-
Method Details
-
from
public static @Nullable FormatConfiguration from(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) Resolve format configuration from annotation metadata.- Parameters:
annotationMetadata- The annotation metadata- Returns:
- The format configuration
-
parseLocale
- Returns:
- The parsed locale, or
nullif no locale is configured
-
parseTimeZone
- Returns:
- The parsed time zone, defaulting to UTC if no time zone is configured
-
createDateFormat
- Returns:
- A date format when a pattern is configured
-
createDateTimeFormatter
- Returns:
- A date-time formatter when a pattern is configured
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
pattern
-
shape
-
locale
-
timezone
-
lenient
-
radix
-