/** * 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(Distribution) */ public DefaultDistribution(final Distribution object) { super(object); if (object != null) { distributionFormats = copyCollection(object.getDistributionFormats(), Format.class); distributors = copyCollection(object.getDistributors(), Distributor.class); transferOptions = copyCollection(object.getTransferOptions(), DigitalTransferOptions.class); if (object instanceof DefaultDistribution) { description = ((DefaultDistribution) object).getDescription(); } } }
/** * 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(Distribution) */ public DefaultDistribution(final Distribution object) { super(object); if (object != null) { distributionFormats = copyCollection(object.getDistributionFormats(), Format.class); distributors = copyCollection(object.getDistributors(), Distributor.class); transferOptions = copyCollection(object.getTransferOptions(), DigitalTransferOptions.class); if (object instanceof DefaultDistribution) { description = ((DefaultDistribution) object).getDescription(); } } }