/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(Format) */ public DefaultFormat(final Format object) { super(object); if (object != null) { amendmentNumber = object.getAmendmentNumber(); fileDecompressionTechnique = object.getFileDecompressionTechnique(); formatDistributors = copyCollection(object.getFormatDistributors(), Distributor.class); if (object instanceof DefaultFormat) { formatSpecificationCitation = ((DefaultFormat) object).getFormatSpecificationCitation(); media = copyCollection(((DefaultFormat) object).getMedia(), Medium.class); } else { setSpecification(object.getSpecification()); setVersion(object.getVersion()); setName(object.getName()); } } }
/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(Format) */ public DefaultFormat(final Format object) { super(object); if (object != null) { amendmentNumber = object.getAmendmentNumber(); fileDecompressionTechnique = object.getFileDecompressionTechnique(); formatDistributors = copyCollection(object.getFormatDistributors(), Distributor.class); if (object instanceof DefaultFormat) { formatSpecificationCitation = ((DefaultFormat) object).getFormatSpecificationCitation(); media = copyCollection(((DefaultFormat) object).getMedia(), Medium.class); } else { setSpecification(object.getSpecification()); setVersion(object.getVersion()); setName(object.getName()); } } }