/** * 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(Event) */ public DefaultEvent(final Event object) { super(object); if (object != null) { identifiers = singleton(object.getIdentifier(), Identifier.class); trigger = object.getTrigger(); context = object.getContext(); sequence = object.getSequence(); time = toMilliseconds(object.getTime()); expectedObjectives = copyCollection(object.getExpectedObjectives(), Objective.class); relatedPass = object.getRelatedPass(); relatedSensors = copyCollection(object.getRelatedSensors(), Instrument.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(Event) */ public DefaultEvent(final Event object) { super(object); if (object != null) { identifiers = singleton(object.getIdentifier(), Identifier.class); trigger = object.getTrigger(); context = object.getContext(); sequence = object.getSequence(); time = toMilliseconds(object.getTime()); expectedObjectives = copyCollection(object.getExpectedObjectives(), Objective.class); relatedPass = object.getRelatedPass(); relatedSensors = copyCollection(object.getRelatedSensors(), Instrument.class); } }