Browse Source

Moved common fields back to the individual entitites

master
Jim Martens 10 months ago
parent
commit
d14361b8fd
  1. 40
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/AgendaItem.java
  2. 37
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Body.java
  3. 43
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/CommonFields.java
  4. 42
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Consultation.java
  5. 41
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/File.java
  6. 39
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/LegislativeTerm.java
  7. 41
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Location.java
  8. 40
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Meeting.java
  9. 41
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Membership.java
  10. 40
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Organization.java
  11. 41
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Paper.java
  12. 42
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Person.java
  13. 41
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/System.java

40
oparl-server/src/main/java/de/twomartens/oparlservice/entity/AgendaItem.java

@ -1,22 +1,52 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class AgendaItem extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AgendaItem {
@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;
@Schema(description = "URL to the meeting this agenda item is part of", nullable = true)
private final String meeting;

37
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Body.java

@ -1,6 +1,7 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
@ -8,13 +9,43 @@ import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public class Body extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Body {
@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;
@Schema(description = "URL to the system this body belongs to", nullable = true)
private final String system;

43
oparl-server/src/main/java/de/twomartens/oparlservice/entity/CommonFields.java

@ -1,43 +0,0 @@
package de.twomartens.oparlservice.entity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
@SuperBuilder
@Getter
@ToString
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@NoArgsConstructor(force = true, access = AccessLevel.PROTECTED)
public class CommonFields {
@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
@Schema(required = true, description = "Date and time of the creation of the object")
private final ZonedDateTime created;
@NonNull
@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;
}

42
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Consultation.java

@ -1,19 +1,51 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Consultation extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Consultation {
@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;
@Schema(description = "URL to the paper related to this consultation", nullable = true)
private final String paper;

41
oparl-server/src/main/java/de/twomartens/oparlservice/entity/File.java

@ -1,21 +1,52 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.LocalDate;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class File extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class File {
@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;
@Schema(description = "name of the file without file ending", nullable = true)
private final String name;

39
oparl-server/src/main/java/de/twomartens/oparlservice/entity/LegislativeTerm.java

@ -1,21 +1,50 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.LocalDate;
import java.time.ZonedDateTime;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class LegislativeTerm extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class LegislativeTerm {
@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;
@Schema(description = "URL to body this legislative term belongs to", nullable = true)
private final String body;

41
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Location.java

@ -1,19 +1,50 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Location extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Location {
@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;
@Schema(description = "description of the location", nullable = true)
private final String description;

40
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Meeting.java

@ -1,21 +1,51 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Meeting extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Meeting {
@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;
@Schema(description = "name of the meeting")
private final String name;

41
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Membership.java

@ -1,20 +1,51 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.LocalDate;
import java.time.ZonedDateTime;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Membership extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Membership {
@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;
@Schema(description = "URL to the person related to this membership", nullable = true)
private final String person;

40
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Organization.java

@ -1,21 +1,51 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.LocalDate;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Organization extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Organization {
@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;
@Schema(description = "URL to body this legislative term belongs to", nullable = true)
private final String body;

41
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Paper.java

@ -1,21 +1,52 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.LocalDate;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Paper extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Paper {
@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;
@Schema(description = "URL to the body this paper belongs to", nullable = true)
private final String body;

42
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Person.java

@ -1,19 +1,51 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Person extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Person {
@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;
@Schema(description = "URL to the body this person belongs so", nullable = true)
private final String body;

41
oparl-server/src/main/java/de/twomartens/oparlservice/entity/System.java

@ -1,19 +1,50 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Builder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class System extends CommonFields {
@JsonInclude(JsonInclude.Include.NON_NULL)
public class System {
@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;
@NonNull
@Schema(required = true, description = "URL to the OParl specification supported by this service")

Loading…
Cancel
Save