/** * Constructs a metadata entity initialized with the values from the specified metadata. * * @param source The metadata to copy, or {@code null} if none. * * @since 2.4 */ public DefaultProcessStep(final ProcessStep source) { super(source); if (source != null) { // Be careful to not overwrite date value (GEOTK-170). if (date == 0 && source.getDate() == null) { date = Long.MIN_VALUE; } } }
/** * 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(ProcessStep) */ public DefaultProcessStep(final ProcessStep object) { super(object); if (object != null) { description = object.getDescription(); rationale = object.getRationale(); stepDateTime = TemporalUtilities.createInstant(object.getDate()); processors = copyCollection(object.getProcessors(), ResponsibleParty.class); sources = copyCollection(object.getSources(), Source.class); outputs = copyCollection(object.getOutputs(), Source.class); processingInformation = object.getProcessingInformation(); reports = copyCollection(object.getReports(), ProcessStepReport.class); if (object instanceof DefaultProcessStep) { references = copyCollection(((DefaultProcessStep) object).getReferences(), Citation.class); scope = ((DefaultProcessStep) object).getScope(); } } }
/** * Wraps the given metadata into a Geotk implementation that can be marshalled, * using the {@code "gmi"} namespace if necessary. * * @param original The original metadata provided by the user. * @return The metadata to marshall. */ public static DefaultProcessStep castOrCopy(final ProcessStep original) { if (original != null && !(original instanceof LE_ProcessStep)) { if (original.getProcessingInformation() != null || !isNullOrEmpty(original.getOutputs()) || !isNullOrEmpty(original.getReports())) { return new LE_ProcessStep(original); } } return DefaultProcessStep.castOrCopy(original); } }
/** * 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(ProcessStep) */ public DefaultProcessStep(final ProcessStep object) { super(object); if (object != null) { description = object.getDescription(); rationale = object.getRationale(); date = toMilliseconds(object.getDate()); processors = copyCollection(object.getProcessors(), ResponsibleParty.class); sources = copyCollection(object.getSources(), Source.class); outputs = copyCollection(object.getOutputs(), Source.class); processingInformation = object.getProcessingInformation(); reports = copyCollection(object.getReports(), ProcessStepReport.class); if (object instanceof DefaultProcessStep) { references = copyCollection(((DefaultProcessStep) object).getReferences(), Citation.class); scope = ((DefaultProcessStep) object).getScope(); } } }
/** * Wraps the given metadata into a SIS implementation that can be marshalled, * using the {@code "gmi"} namespace if necessary. * * @param original the original metadata provided by the user. * @return the metadata to marshall. */ public static DefaultProcessStep castOrCopy(final ProcessStep original) { if (original != null && !(original instanceof LE_ProcessStep)) { if (original.getProcessingInformation() != null || !isNullOrEmpty(original.getOutputs()) || !isNullOrEmpty(original.getReports())) { return new LE_ProcessStep(original); } } return DefaultProcessStep.castOrCopy(original); } }
/** * Wraps the given metadata into a SIS implementation that can be marshalled, * using the {@code "gmi"} namespace if necessary. * * @param original the original metadata provided by the user. * @return the metadata to marshall. */ public static DefaultProcessStep castOrCopy(final ProcessStep original) { if (original != null && !(original instanceof LE_ProcessStep)) { if (original.getProcessingInformation() != null || !isNullOrEmpty(original.getOutputs()) || !isNullOrEmpty(original.getReports())) { return new LE_ProcessStep(original); } } return DefaultProcessStep.castOrCopy(original); } }