85 lines
3.0 KiB
Java
85 lines
3.0 KiB
Java
package org.gcube.application.geoportal.common.model.document;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import com.vdurmont.semver4j.Semver;
|
|
import lombok.*;
|
|
import org.bson.Document;
|
|
import org.gcube.application.geoportal.common.model.document.accounting.PublicationInfo;
|
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
|
import org.gcube.application.geoportal.common.model.document.temporal.TemporalReference;
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Objects;
|
|
|
|
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@Getter
|
|
@Setter
|
|
@ToString
|
|
public class Project {
|
|
|
|
public static final String ID="_id";
|
|
public static final String VERSION="_version";
|
|
public static final String INFO="_info";
|
|
public static final String PROFILE_ID="_profileID";
|
|
public static final String PROFILE_VERSION="_profileVersion";
|
|
public static final String LIFECYCLE_INFORMATION="_lifecycleInformation";
|
|
public static final String RELATIONSHIPS="_relationships";
|
|
public static final String SPATIAL_REFERENCE="_spatialReference";
|
|
public static final String TEMPORAL_REFERENCE="_temporalReference";
|
|
public static final String THE_DOCUMENT="_theDocument";
|
|
public static final String LOCK="_lock";
|
|
|
|
// CORE METADATA
|
|
|
|
@JsonProperty(ID)
|
|
private String id;
|
|
@JsonProperty(VERSION)
|
|
private Semver version;
|
|
|
|
// Publication Info
|
|
@JsonProperty(INFO)
|
|
private PublicationInfo info;
|
|
|
|
// UseCaseDescriptor reference
|
|
@JsonProperty(PROFILE_ID)
|
|
private String profileID;
|
|
@JsonProperty(PROFILE_VERSION)
|
|
private Semver profileVersion;
|
|
|
|
@JsonProperty(LIFECYCLE_INFORMATION)
|
|
private LifecycleInformation lifecycleInformation;
|
|
|
|
@JsonProperty(RELATIONSHIPS)
|
|
private Relationship[] relationships;
|
|
|
|
// Expected GEOJSON
|
|
@JsonProperty(SPATIAL_REFERENCE)
|
|
private Document spatialReference;
|
|
|
|
@JsonProperty(TEMPORAL_REFERENCE)
|
|
private TemporalReference temporalReference;
|
|
|
|
@JsonProperty(THE_DOCUMENT)
|
|
private Document theDocument;
|
|
|
|
@JsonProperty(LOCK)
|
|
private Lock lock;
|
|
|
|
|
|
/**
|
|
* Similar to equals but without checking following fields
|
|
*
|
|
* lock
|
|
* @param o
|
|
* @return
|
|
*/
|
|
public boolean isEquivalent(Object o) {
|
|
if (this == o) return true;
|
|
if (!(o instanceof Project)) return false;
|
|
Project project = (Project) o;
|
|
return Objects.equals(getId(), project.getId()) && Objects.equals(getVersion(), project.getVersion()) && Objects.equals(getInfo(), project.getInfo()) && Objects.equals(getProfileID(), project.getProfileID()) && Objects.equals(getProfileVersion(), project.getProfileVersion()) && Objects.equals(getLifecycleInformation(), project.getLifecycleInformation()) && Arrays.equals(getRelationships(), project.getRelationships()) && Objects.equals(getSpatialReference(), project.getSpatialReference()) && Objects.equals(getTemporalReference(), project.getTemporalReference()) && Objects.equals(getTheDocument(), project.getTheDocument());
|
|
}
|
|
}
|