-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding json resource, and TimeZones class
Added TimeZones class so we can deserialize to and from a list object like LocationLevels.
- Loading branch information
Showing
5 changed files
with
1,921 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
cwms-data-api/src/main/java/cwms/cda/data/dto/TimeZones.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (c) 2024. Hydrologic Engineering Center (HEC). | ||
* United States Army Corps of Engineers | ||
* All Rights Reserved. HEC PROPRIETARY/CONFIDENTIAL. | ||
* Source may not be released without written approval from HEC | ||
*/ | ||
|
||
package cwms.cda.data.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonRootName; | ||
import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
import cwms.cda.api.errors.FieldException; | ||
import cwms.cda.formatters.Formats; | ||
import cwms.cda.formatters.annotations.FormattableWith; | ||
import cwms.cda.formatters.json.JsonV2; | ||
import cwms.cda.formatters.xml.XMLv2; | ||
|
||
import java.util.List; | ||
|
||
@JsonRootName("time-zones") | ||
@FormattableWith(contentType = Formats.JSONV2, formatter = JsonV2.class, aliases = {Formats.DEFAULT, Formats.JSON}) | ||
@FormattableWith(contentType = Formats.XMLV2, formatter = XMLv2.class, aliases = {Formats.XML}) | ||
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy.class) | ||
public final class TimeZones extends CwmsDTO | ||
{ | ||
private List<TimeZone> timeZones; | ||
|
||
@SuppressWarnings("unused") // for JAXB to handle marshalling | ||
private TimeZones() | ||
{ | ||
super(null); | ||
} | ||
|
||
public TimeZones(List<TimeZone> timeZones) | ||
{ | ||
super(null); | ||
this.timeZones = timeZones; | ||
} | ||
|
||
public List<TimeZone> getTimeZones() | ||
{ | ||
return timeZones; | ||
} | ||
|
||
@Override | ||
public void validate() throws FieldException | ||
{ | ||
//No validation needed | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.