/** * 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 DefaultPlatformPass}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultPlatformPass} instance is created using the * {@linkplain #DefaultPlatformPass(PlatformPass) 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 DefaultPlatformPass castOrCopy(final PlatformPass object) { if (object == null || object instanceof DefaultPlatformPass) { return (DefaultPlatformPass) object; } return new DefaultPlatformPass(object); }
/** * Sets the area covered by the pass. * * @param newValue the new extent value. */ public void setExtent(final Geometry newValue) { checkWritePermission(extent); extent = newValue; }
/** * Returns the occurrence of one or more events for a pass. * * @return occurrence of one or more events for a pass. */ @Override @XmlElement(name = "relatedEvent") public Collection<Event> getRelatedEvents() { return relatedEvents = nonNullCollection(relatedEvents, Event.class); }
/** * 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(PlatformPass) */ public DefaultPlatformPass(final PlatformPass object) { super(object); if (object != null) { identifiers = singleton(object.getIdentifier(), Identifier.class); extent = object.getExtent(); relatedEvents = copyCollection(object.getRelatedEvents(), Event.class); } }
/** * Sets the unique name of the pass. * * @param newValue the new identifier value. */ public void setIdentifier(final Identifier newValue) { checkWritePermission(); identifiers = nonNullCollection(identifiers, Identifier.class); NonMarshalledAuthority.setMarshallable(identifiers, newValue); }
/** * Sets the occurrence of one or more events for a pass. * * @param newValues the new related events values. */ public void setRelatedEvents(final Collection<? extends Event> newValues) { relatedEvents = writeCollection(newValues, relatedEvents, Event.class); } }
/** * Invoked by JAXB at marshalling time for getting the actual metadata to write * inside the {@code <mac:MI_PlatformPass>} XML element. * This is the value or a copy of the value given in argument to the {@code wrap} method. * * @return the metadata to be marshalled. */ @XmlElementRef public DefaultPlatformPass getElement() { return DefaultPlatformPass.castOrCopy(metadata); }
/** * 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(PlatformPass) */ public DefaultPlatformPass(final PlatformPass object) { super(object); if (object != null) { identifiers = singleton(object.getIdentifier(), Identifier.class); extent = object.getExtent(); relatedEvents = copyCollection(object.getRelatedEvents(), Event.class); } }
/** * Sets the occurrence of one or more events for a pass. * * @param newValues the new related events values. */ public void setRelatedEvents(final Collection<? extends Event> newValues) { relatedEvents = writeCollection(newValues, relatedEvents, Event.class); } }
/** * Invoked by JAXB at marshalling time for getting the actual metadata to write * inside the {@code <gmi:MI_PlatformPass>} XML element. * This is the value or a copy of the value given in argument to the {@code wrap} method. * * @return the metadata to be marshalled. */ @XmlElementRef public DefaultPlatformPass getElement() { return DefaultPlatformPass.castOrCopy(metadata); }
/** * Returns the occurrence of one or more events for a pass. * * @return occurrence of one or more events for a pass. */ @Override @XmlElement(name = "relatedEvent") public Collection<Event> getRelatedEvents() { return relatedEvents = nonNullCollection(relatedEvents, Event.class); }
/** * Sets the area covered by the pass. * * @param newValue the new extent value. */ public void setExtent(final Geometry newValue) { checkWritePermission(); extent = newValue; }
/** * 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 DefaultPlatformPass}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultPlatformPass} instance is created using the * {@linkplain #DefaultPlatformPass(PlatformPass) 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 DefaultPlatformPass castOrCopy(final PlatformPass object) { if (object == null || object instanceof DefaultPlatformPass) { return (DefaultPlatformPass) object; } return new DefaultPlatformPass(object); }