/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultOperation}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultOperation} instance is created using the * {@linkplain #DefaultOperation(Operation) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultOperation castOrCopy(final Operation object) { if (object == null || object instanceof DefaultOperation) { return (DefaultOperation) object; } return new DefaultOperation(object); }
/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultOperation}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultOperation} instance is created using the * {@linkplain #DefaultOperation(Operation) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultOperation castOrCopy(final Operation object) { if (object == null || object instanceof DefaultOperation) { return (DefaultOperation) object; } return new DefaultOperation(object); }
/** * Adds the identifier of the operation used to acquire the dataset. * Examples: "GHRSST", "NOAA CDR", "NASA EOS", "JPSS", "GOES-R". * Storage location is: * * <ul> * <li>{@code metadata/acquisitionInformation/operation/identifier}</li> * </ul> * * @param program identification of the mission, or {@code null} if none. * @param identifier unique identification of the operation, or {@code null} for no-operation. */ public final void addAcquisitionOperation(final CharSequence program, String identifier) { if (identifier != null && !(identifier = identifier.trim()).isEmpty()) { final DefaultOperation r = new DefaultOperation(); r.setIdentifier(sharedIdentifier(program, identifier)); addIfNotPresent(acquisition().getOperations(), r); } }
/** * Adds the identifier of the operation used to acquire the dataset. * Examples: "GHRSST", "NOAA CDR", "NASA EOS", "JPSS", "GOES-R". * Storage location is: * * <ul> * <li>{@code metadata/acquisitionInformation/operation/identifier}</li> * </ul> * * @param program identification of the mission, or {@code null} if none. * @param identifier unique identification of the operation, or {@code null} for no-operation. */ public final void addAcquisitionOperation(final CharSequence program, String identifier) { if (identifier != null && !(identifier = identifier.trim()).isEmpty()) { final DefaultOperation r = new DefaultOperation(); r.setIdentifier(sharedIdentifier(program, identifier)); addIfNotPresent(acquisition().getOperations(), r); } }
/** * Adds an event that describe the time at which data were acquired. * Storage location is: * * <ul> * <li>{@code metadata/acquisitionInformation/operation/significantEvent/time}</li> * </ul> * * @param time the acquisition time, or {@code null} for no-operation. * * @see #addTemporalExtent(Date, Date) */ public final void addAcquisitionTime(final Date time) { if (time != null) { final DefaultEvent event = new DefaultEvent(); event.setContext(Context.ACQUISITION); event.setTime(time); final DefaultOperation op = new DefaultOperation(); op.setSignificantEvents(singleton(event)); op.setType(OperationType.REAL); op.setStatus(Progress.COMPLETED); addIfNotPresent(acquisition().getOperations(), op); } }
/** * Adds an event that describe the time at which data were acquired. * Storage location is: * * <ul> * <li>{@code metadata/acquisitionInformation/operation/significantEvent/time}</li> * </ul> * * @param time the acquisition time, or {@code null} for no-operation. * * @see #addTemporalExtent(Date, Date) */ public final void addAcquisitionTime(final Date time) { if (time != null) { final DefaultEvent event = new DefaultEvent(); event.setContext(Context.ACQUISITION); event.setTime(time); final DefaultOperation op = new DefaultOperation(); op.setSignificantEvents(singleton(event)); op.setType(OperationType.REAL); op.setStatus(Progress.COMPLETED); addIfNotPresent(acquisition().getOperations(), op); } }