Extracted common fields into parent class

This commit is contained in:
2020-07-08 23:48:33 +02:00
parent 9b570d53c6
commit 21f04fa6e2
6 changed files with 127 additions and 140 deletions

View File

@ -1,51 +1,20 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@Builder
@SuperBuilder
@Getter
@ToString
@EqualsAndHashCode
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public class System {
// common fields
@NonNull
@Schema(required = true, description = "The unique identifier of the object")
private final String id;
@Schema(allOf = CommonFields.class)
public class System extends CommonFields {
@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
@NonNull
@Schema(required = true, description = "URL to the OParl specification supported by this service")
private final String oparlVersion;