package eu.dnetlib.scholix.api.model.v1; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; import java.util.Objects; public class ScholixItem { @JsonProperty("identifier") private ScholixIdentifier identifier; @JsonProperty("objectType") private String objectType; @JsonProperty("objectSubType") private String objectSubType; @JsonProperty("title") private String title; @JsonProperty("creator") private List creator; @JsonProperty("publicationDate") private String publicationDate; @JsonProperty("publisher") private ScholixProvider publisher; public ScholixItem identifier(ScholixIdentifier identifier) { this.identifier = identifier; return this; } @Schema(description = "The identifier string") public ScholixIdentifier getIdentifier() { return identifier; } public void setIdentifier(ScholixIdentifier identifier) { this.identifier = identifier; } public ScholixItem objectType(String objectType) { this.objectType = objectType; return this; } @Schema(description = "Describes the nature of the object (its intended usage)") public String getObjectType() { return objectType; } public void setObjectType(String objectType) { this.objectType = objectType; } public ScholixItem objectSubType(String objectSubType) { this.objectSubType = objectSubType; return this; } @Schema(description = "The sub-type of Object") public String getObjectSubType() { return objectSubType; } public void setObjectSubType(String objectSubType) { this.objectSubType = objectSubType; } public ScholixItem title(String title) { this.title = title; return this; } @Schema(description = "The name of the object") public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public ScholixItem creator(List creator) { this.creator = creator; return this; } public ScholixItem addCreatorInstance(ScholixCreator creatorInstance) { if(this.creator == null) this.creator = new ArrayList<>(); this.creator.add(creatorInstance); return this; } @Schema(description = "Party responsible for the creation of the object") public List getCreator() { return creator; } public void setCreator(List creator) { this.creator = creator; } @Schema(description = "The date the object was formally issued, published or distributed") public String getPublicationDate() { return publicationDate; } public void setPublicationDate(String publicationDate) { this.publicationDate = publicationDate; } @Schema(description = "The name of the publisher of the object") public ScholixProvider getPublisher() { return publisher; } public void setPublisher(ScholixProvider publisher) { this.publisher = publisher; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ScholixItem scholixItemType = (ScholixItem) o; return Objects.equals(this.objectType, scholixItemType.objectType) && Objects.equals(this.objectSubType, scholixItemType.objectSubType) && Objects.equals(this.identifier, scholixItemType.identifier) && Objects.equals(this.title, scholixItemType.title) && Objects.equals(this.creator, scholixItemType.creator) && Objects.equals(this.publicationDate, scholixItemType.publicationDate) && Objects.equals(this.publisher, scholixItemType.publisher); } @Override public int hashCode() { return Objects.hash(objectType, objectSubType, identifier, title, creator, publicationDate, publisher); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ScholixItemType {\n"); sb.append(" objectType: ").append(toIndentedString(objectType)).append("\n"); sb.append(" objectSubType: ").append(toIndentedString(objectSubType)).append("\n"); sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" creator: ").append(toIndentedString(creator)).append("\n"); sb.append(" publicationDate: ").append(toIndentedString(publicationDate)).append("\n"); sb.append(" publisher: ").append(toIndentedString(publisher)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }