File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
smithy-model/src/main/java/software/amazon/smithy/model/traits Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,11 @@ public final class TimestampFormatTrait extends StringTrait {
1616 public static final String HTTP_DATE = "http-date" ;
1717 public static final ShapeId ID = ShapeId .from ("smithy.api#timestampFormat" );
1818
19+ private final Format format ;
20+
1921 public TimestampFormatTrait (String value , SourceLocation sourceLocation ) {
2022 super (ID , value , sourceLocation );
23+ this .format = Format .fromString (getValue ());
2124 }
2225
2326 public TimestampFormatTrait (String value ) {
@@ -30,7 +33,7 @@ public TimestampFormatTrait(String value) {
3033 * @return Returns the {@code Format} enum.
3134 */
3235 public Format getFormat () {
33- return Format . fromString ( getValue ()) ;
36+ return format ;
3437 }
3538
3639 public static final class Provider extends StringTrait .Provider <TimestampFormatTrait > {
@@ -48,7 +51,7 @@ public enum Format {
4851 HTTP_DATE (TimestampFormatTrait .HTTP_DATE ),
4952 UNKNOWN ("unknown" );
5053
51- private String value ;
54+ private final String value ;
5255
5356 Format (String value ) {
5457 this .value = value ;
You can’t perform that action at this time.
0 commit comments