/** * 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. */ public DefaultIndividual(final DefaultIndividual object) { super(object); if (object != null) { positionName = object.getPositionName(); } }
/** * 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. */ public DefaultIndividual(final DefaultIndividual object) { super(object); if (object != null) { positionName = object.getPositionName(); } }
/** * Returns the name of the first party of the given type, or {@code null} if none. * * @param position {@code true} for returning the position name instead than individual name. * @return the name or position of the first individual, or {@code null}. * * @see #getOrganisationName() * @see #getIndividualName() * @see #getPositionName() */ private static InternationalString getName(final Collection<? extends AbstractParty> parties, final Class<? extends AbstractParty> type, final boolean position) { InternationalString name = null; if (parties != null) { // May be null on marshalling. for (final AbstractParty party : parties) { if (type.isInstance(party)) { if (name != null) { LegacyPropertyAdapter.warnIgnoredExtraneous(type, DefaultResponsibleParty.class, position ? "getPositionName" : (type == DefaultIndividual.class) ? "getIndividualName" : "getOrganisationName"); break; } name = position ? ((DefaultIndividual) party).getPositionName() : party.getName(); } } } return name; }
/** * Returns the name of the first party of the given type, or {@code null} if none. * * @param position {@code true} for returning the position name instead than individual name. * @return the name or position of the first individual, or {@code null}. * * @see #getOrganisationName() * @see #getIndividualName() * @see #getPositionName() */ private static InternationalString getName(final Collection<? extends AbstractParty> parties, final Class<? extends AbstractParty> type, final boolean position) { InternationalString name = null; if (parties != null) { // May be null on marshalling. for (final AbstractParty party : parties) { if (type.isInstance(party)) { if (name != null) { LegacyPropertyAdapter.warnIgnoredExtraneous(type, DefaultResponsibleParty.class, position ? "getPositionName" : (type == DefaultIndividual.class) ? "getIndividualName" : "getOrganisationName"); break; } name = position ? ((DefaultIndividual) party).getPositionName() : party.getName(); } } } return name; }