/** * 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(FeatureCatalogueDescription) */ public DefaultFeatureCatalogueDescription(final FeatureCatalogueDescription object) { super(object); if (object != null) { compliant = object.isCompliant(); includedWithDataset = object.isIncludedWithDataset(); languages = copyCollection(object.getLanguages(), Locale.class); featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class); if (object instanceof DefaultFeatureCatalogueDescription) { featureTypes = copyCollection(((DefaultFeatureCatalogueDescription) object).getFeatureTypeInfo(), DefaultFeatureTypeInfo.class); } else { setFeatureTypes(object.getFeatureTypes()); } } }
/** * 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(FeatureCatalogueDescription) */ public DefaultFeatureCatalogueDescription(final FeatureCatalogueDescription object) { super(object); if (object != null) { compliant = object.isCompliant(); includedWithDataset = object.isIncludedWithDataset(); languages = copyCollection(object.getLanguages(), Locale.class); featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class); if (object instanceof DefaultFeatureCatalogueDescription) { featureTypes = copyCollection(((DefaultFeatureCatalogueDescription) object).getFeatureTypeInfo(), DefaultFeatureTypeInfo.class); } else { setFeatureTypes(object.getFeatureTypes()); } } }
assertEquals("includedWithDataset", Boolean.TRUE, features.isIncludedWithDataset()); final Iterator<? extends Citation> ci = features.getFeatureCatalogueCitations().iterator(); assertEquals("GPX file", ci.next().getTitle().toString()); assertEquals("Shapefile", ci.next().getTitle().toString());