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

106 lines
3.5 KiB
Java
Raw Normal View History

2020-07-10 19:17:21 +02:00
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
2020-07-10 19:17:21 +02:00
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.time.ZonedDateTime;
2020-07-10 19:17:21 +02:00
import java.util.List;
@Builder
2020-07-10 19:17:21 +02:00
@Getter
@ToString
@EqualsAndHashCode
2020-07-10 19:17:21 +02:00
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@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")
private String license;
@Schema(description = "Categorization of the object")
private String keyword;
@Schema(description = "URL of a website that presents the object in the browser")
private String web;
@Schema(description = "True, if the object was deleted")
private final boolean deleted;
@Schema(description = "name of the file without file ending")
2020-07-10 19:17:21 +02:00
private final String name;
@Schema(description = "file name of the file")
2020-07-10 19:17:21 +02:00
private final String fileName;
@Schema(description = "mime type of this file")
2020-07-10 19:17:21 +02:00
private final String mimeType;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@Schema(description = "date which is used, for example, as a reference for deadlines")
2020-07-10 19:17:21 +02:00
private final LocalDate date;
@Schema(description = "size of the file in bytes")
private final int size;
@Schema(description = "SHA1 checksum of the file content in hexadecimal form", deprecated = true)
2020-07-10 19:17:21 +02:00
private final String sha1Checksum;
@Schema(description = "SHA512 checksum of the file content in hexadecimal form")
2020-07-10 19:17:21 +02:00
private final String sha512Checksum;
@Schema(description = "pure text representation of the file content if possible")
2020-07-10 19:17:21 +02:00
private final String text;
2020-07-10 19:18:47 +02:00
@NonNull
2020-07-10 19:17:21 +02:00
@Schema(description = "URL to access the file", required = true)
private final String accessUrl;
@Schema(description = "URL to download the file")
2020-07-10 19:17:21 +02:00
private final String downloadUrl;
@Schema(description = "URL to an additional access possibility")
2020-07-10 19:17:21 +02:00
private final String externalServiceUrl;
@Schema(description = "URL to the master file from which this file was derived")
2020-07-10 19:17:21 +02:00
private final String masterFile;
@Schema(description = "List of URLs to files that were derived from this file")
2020-07-10 19:17:21 +02:00
private final List<String> derivativeFile;
@Schema(description = "URL to the license for this file")
2020-07-10 19:17:21 +02:00
private final String fileLicense;
@Schema(description = "List of URLs to meetings this file is referenced in")
2020-07-10 19:17:21 +02:00
private final List<String> meeting;
@Schema(description = "List of URLs to agenda items this file is referenced in")
2020-07-10 19:17:21 +02:00
private final List<String> agendaItem;
@Schema(description = "URL to the person which uses this file as image")
2020-07-10 19:17:21 +02:00
private final String person;
@Schema(description = "List of URLs to papers this file is referenced in")
2020-07-10 19:17:21 +02:00
private final List<String> paper;
}