package de.twomartens.oparlservice.entity; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import javax.swing.*; import java.time.LocalDate; import java.time.ZonedDateTime; @Builder @Getter @ToString @EqualsAndHashCode @AllArgsConstructor(access = AccessLevel.PRIVATE) @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) public class LegislativeTerm { // common fields @NonNull @Schema(required = true, description = "The unique identifier of the object") private final String id; @NonNull @Schema(required = true, description = "Namespace URL to the object type schema") private final String type; @NonNull @JsonFormat(shape = JsonFormat.Shape.STRING) @Schema(required = true, description = "Date and time of the creation of the object") private final ZonedDateTime created; @NonNull @JsonFormat(shape = JsonFormat.Shape.STRING) @Schema(required = true, description = "Date and time of the last update of the object") private final ZonedDateTime modified; @Schema(description = "URL to the license", nullable = true) private String license; @Schema(description = "Categorization of the object", nullable = true) private String keyword; @Schema(description = "URL of a website that presents the object in the browser", nullable = true) private String web; @Schema(description = "True, if the object was deleted") private final boolean deleted; // bespoke fields @Schema(description = "URL to body this legislative term belongs to", nullable = true) private final String body; @Schema(description = "User friendly name of legislative term", nullable = true) private final String name; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") @Schema(description = "First day of legislative term", nullable = true) private final LocalDate startDate; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") @Schema(description = "Last day of legislative term", nullable = true) private final LocalDate endDate; }