/** * Copy constructor for a DcsFormat. The state of <code>toCopy</code> is copied * to this. * * @param toCopy the dcs format to copy */ public DcsFormat(DcsFormat toCopy) { this.format = toCopy.getFormat(); this.version = toCopy.getVersion(); this.name = toCopy.getName(); this.schemeUri = toCopy.getSchemeUri(); }
/** * Copy constructor for DcsMetadata. The state of <code>toCopy</code> is copied * to this. * * @param toCopy the metadata to copy */ public DcsMetadata(DcsMetadata toCopy) { this.schemaUri = toCopy.getSchemaUri(); this.metadata = toCopy.getMetadata(); this.metadataUsedByHashcode = toCopy.metadataUsedByHashcode; }
private DcsFile getFirstFileOf(Dcp dcp, DcsManifestation man) { for (DcsFile test : dcp.getFiles()) { for (DcsManifestationFile mf : man.getManifestationFiles()) { if (mf.getRef().getRef().equals(test.getId())) { return test; } } } return null; }
private Set<String> getCollectionRels(DcsEntity collection) { Set<String> rels = new HashSet<String>(); DcsCollection coll = (DcsCollection) collection; for (DcsEntityReference ref : coll.getMetadataRef()) { rels.add(ref.getRef()); } if (coll.getParent() != null) { rels.add(coll.getParent().getRef()); } return rels; }
/** * Creates a DcsRelationship with a relationship type of <code>rel</code> with <code>target</code>. See * {@link DcsRelationship} for supported relationship types. * * @param rel the relationship type, must not be <code>null</code> * @param target the target entity, must not be empty or <code>null</code> */ public DcsRelation(DcsRelationship rel, String target) { Assertion.notNull(rel); Assertion.notEmptyOrNull(target); this.relUri = rel.asString(); this.ref = new DcsEntityReference(target); }
private DcsCollectionRef createCollectionRef(String string) { DcsCollectionRef ref = new DcsCollectionRef(); ref.setRef(string); return ref; }
@Override public Set<DcsFormat> getFormats() { return fileDelegate.getFormats(); }
@Override public long getSizeBytes() { return fileDelegate.getSizeBytes(); }
CoreMetadata(CoreMetadata toCopy) { this.creators = toCopy.getCreators(); this.subjects = toCopy.getSubjects(); this.type = toCopy.getType(); this.title = toCopy.getTitle(); this.rights = toCopy.getRights(); }
@Override public Set<DcsMetadata> getMetadata() { return fileDelegate.getMetadata(); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; DcsCollection that = (DcsCollection) o; if (coreMd != null ? !coreMd.equals(that.coreMd) : that.coreMd != null) return false; if (metadata != null ? !metadata.equals(that.metadata) : that.metadata != null) return false; if (metadataRef != null ? !metadataRef.equals(that.metadataRef) : that.metadataRef != null) return false; if (parent != null ? !parent.equals(that.parent) : that.parent != null) return false; return true; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (coreMd != null ? coreMd.hashCode() : 0); result = 31 * result + (parent != null ? parent.hashCode() : 0); result = 31 * result + (metadata != null ? metadata.hashCode() : 0); result = 31 * result + (metadataRef != null ? metadataRef.hashCode() : 0); return result; }
/** * Set the subject(s) of the collection. * * @param subjects the subjects, must not be <code>null</code> * @throws IllegalArgumentException if <code>subjects</code> is <code>null</code> or the empty string */ public void setSubjects(Set<String> subjects) { coreMd.setSubjects(subjects); }
/** * Set the creator(s) of the deliverable unit. * * @param creators the creators, must not be <code>null</code> * @throws IllegalArgumentException if <code>creators</code> is <code>null</code> or the empty string */ public void setCreators(Set<String> creators) { coreMd.setCreators(creators); }
/** * Add a subject * * @param subject the subject, must not be <code>null</code> * @throws IllegalArgumentException if <code>subject</code> is <code>null</code> or the empty string */ public void addSubject(String... subject) { coreMd.addSubject(subject); }
private String getPredecessorId(DcsDeliverableUnit du) { for (DcsRelation rel : du.getRelations()) { if (rel.getRelUri().equals( DcsRelationship.IS_SUCCESSOR_OF.asString())) { if (rel.getRef() == null || rel.getRef().getRef() == null) { return null; } return rel.getRef().getRef(); } } return null; }
private Set<String> getCollectionRels(DcsEntity collection) { Set<String> rels = new HashSet<String>(); DcsCollection coll = (DcsCollection) collection; for (DcsEntityReference ref : coll.getMetadataRef()) { rels.add(ref.getRef()); } if (coll.getParent() != null) { rels.add(coll.getParent().getRef()); } return rels; }