Skip to content

Commit

Permalink
Working on API object
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Apr 24, 2024
1 parent 40462e1 commit 06854bc
Show file tree
Hide file tree
Showing 12 changed files with 702 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package org.orcid.api.member.model;

import java.util.Objects;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.orcid.jaxb.model.v3.release.common.FuzzyDate;

import io.swagger.v3.oas.annotations.media.Schema;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "putCode", "endDate", "organizationName", "validated" })
@XmlRootElement(name = "employment", namespace = "http://www.orcid.org/ns/summary")
@Schema(description = "Employment")
public class Employment {
@XmlElement(name = "put-code", namespace = "http://www.orcid.org/ns/summary")
private Long putCode;
@XmlElement(name = "end-date", namespace = "http://www.orcid.org/ns/common")
private FuzzyDate endDate;
@XmlElement(name = "organization-name", namespace = "http://www.orcid.org/ns/summary")
private String organizationName;
@XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/summary")
private boolean validated;

public Long getPutCode() {
return putCode;
}

public void setPutCode(Long putCode) {
this.putCode = putCode;
}

public FuzzyDate getEndDate() {
return endDate;
}

public void setEndDate(FuzzyDate endDate) {
this.endDate = endDate;
}

public String getOrganizationName() {
return organizationName;
}

public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}

public boolean isValidated() {
return validated;
}

public void setValidated(boolean validated) {
this.validated = validated;
}

@Override
public int hashCode() {
return Objects.hash(endDate, organizationName, putCode, validated);
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Employment other = (Employment) obj;
return Objects.equals(endDate, other.endDate) && Objects.equals(organizationName, other.organizationName) && Objects.equals(putCode, other.putCode)
&& validated == other.validated;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package org.orcid.api.member.model;

import java.util.List;
import java.util.Objects;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import io.swagger.v3.oas.annotations.media.Schema;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "count", "employments" })
@XmlRootElement(name = "employments", namespace = "http://www.orcid.org/ns/summary")
@Schema(description = "Employments list")
public class Employments {
@XmlElement(name = "count", namespace = "http://www.orcid.org/ns/activities")
private Integer count;
@XmlElement(name = "employment", namespace = "http://www.orcid.org/ns/activities")
private List<Employment> employments;

public Integer getCount() {
return count;
}

public void setCount(Integer count) {
this.count = count;
}

public List<Employment> getEmployments() {
return employments;
}

public void setEmployments(List<Employment> employments) {
this.employments = employments;
}

@Override
public int hashCode() {
return Objects.hash(count, employments);
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Employments other = (Employments) obj;
return Objects.equals(count, other.count) && Objects.equals(employments, other.employments);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package org.orcid.api.member.model;

import java.util.Objects;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import io.swagger.v3.oas.annotations.media.Schema;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "putCode", "externalIdType", "externalIdValue", "externalIdUrl", "validated" })
@XmlRootElement(name = "external-identifier", namespace = "http://www.orcid.org/ns/summary")
@Schema(description = "External identifier")
public class ExternalIdentifier {
@XmlElement(name = "put-code", namespace = "http://www.orcid.org/ns/activities")
private Long putCode;
@XmlElement(name = "external-id-type", namespace = "http://www.orcid.org/ns/activities")
private String externalIdType;
@XmlElement(name = "external-id-value", namespace = "http://www.orcid.org/ns/activities")
private String externalIdValue;
@XmlElement(name = "external-id-url", namespace = "http://www.orcid.org/ns/activities")
private String externalIdUrl;
@XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/activities")
private boolean validated;

public Long getPutCode() {
return putCode;
}

public void setPutCode(Long putCode) {
this.putCode = putCode;
}

public String getExternalIdType() {
return externalIdType;
}

public void setExternalIdType(String externalIdType) {
this.externalIdType = externalIdType;
}

public String getExternalIdValue() {
return externalIdValue;
}

public void setExternalIdValue(String externalIdValue) {
this.externalIdValue = externalIdValue;
}

public String getExternalIdUrl() {
return externalIdUrl;
}

public void setExternalIdUrl(String externalIdUrl) {
this.externalIdUrl = externalIdUrl;
}

public boolean isValidated() {
return validated;
}

public void setValidated(boolean validated) {
this.validated = validated;
}

@Override
public int hashCode() {
return Objects.hash(externalIdType, externalIdUrl, externalIdValue, putCode, validated);
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ExternalIdentifier other = (ExternalIdentifier) obj;
return Objects.equals(externalIdType, other.externalIdType) && Objects.equals(externalIdUrl, other.externalIdUrl)
&& Objects.equals(externalIdValue, other.externalIdValue) && Objects.equals(putCode, other.putCode) && validated == other.validated;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.orcid.api.member.model;

import java.util.List;
import java.util.Objects;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import io.swagger.v3.oas.annotations.media.Schema;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "externalIdentifiers" })
@XmlRootElement(name = "external-identifiers", namespace = "http://www.orcid.org/ns/summary")
@Schema(description = "External identifiers list")
public class ExternalIdentifiers {
@XmlElement(name = "external-identifier", namespace = "http://www.orcid.org/ns/activities")
List<ExternalIdentifier> externalIdentifiers;

public List<ExternalIdentifier> getExternalIdentifiers() {
return externalIdentifiers;
}

public void setExternalIdentifiers(List<ExternalIdentifier> externalIdentifiers) {
this.externalIdentifiers = externalIdentifiers;
}

@Override
public int hashCode() {
return Objects.hash(externalIdentifiers);
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ExternalIdentifiers other = (ExternalIdentifiers) obj;
return Objects.equals(externalIdentifiers, other.externalIdentifiers);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.orcid.api.member.model;

import javax.xml.bind.annotation.XmlRootElement;

import io.swagger.v3.oas.annotations.media.Schema;

@XmlRootElement(name = "fundings", namespace = "http://www.orcid.org/ns/summary")
@Schema(description = "Fundings")
public class Fundings extends ItemsCount {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package org.orcid.api.member.model;

import java.util.Objects;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import io.swagger.v3.oas.annotations.media.Schema;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "selfAssertedCount", "validatedCount" })
@Schema(description = "Items count abstract class")
public abstract class ItemsCount {
@XmlElement(name = "self-asserted-count", namespace = "http://www.orcid.org/ns/summary")
private Integer selfAssertedCount;
@XmlElement(name = "validated-count", namespace = "http://www.orcid.org/ns/summary")
private Integer validatedCount;

public Integer getSelfAssertedCount() {
return selfAssertedCount;
}

public void setSelfAssertedCount(Integer selfAssertedCount) {
this.selfAssertedCount = selfAssertedCount;
}

public Integer getValidatdeCount() {
return validatedCount;
}

public void setValidatedCount(Integer validatedCount) {
this.validatedCount = validatedCount;
}

@Override
public int hashCode() {
return Objects.hash(selfAssertedCount, validatedCount);
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ItemsCount other = (ItemsCount) obj;
return Objects.equals(selfAssertedCount, other.selfAssertedCount) && Objects.equals(validatedCount, other.validatedCount);
}
}
Loading

0 comments on commit 06854bc

Please sign in to comment.