/** * Returns the programmatic name of this constant together with its {@linkplain #identifier() identifier}, if any. * * @since 3.1 */ @Override public String[] names() { return new String[] {name(), identifier}; }
/** * Returns all constants defined by this enumeration type. * Invoking this method is equivalent to invoking {@link #values()}, except that this * method can be invoked on an instance of the {@code ControlledVocabulary} interface * (i.e. the enumeration type does not need to be known at compile-time). * * @return all {@linkplain #values() values} for this enumeration. * * @since 3.1 */ @Override public Obligation[] family() { return values(); } }
/** * Converts the given {@code ExtendedElementInformation} to a {@code ValueRestriction}. */ public static ValueRestriction create(final ExtendedElementInformation info) { if (info != null) { final Obligation o = info.getObligation(); final InternationalString domain = info.getDomainValue(); return create((o != null) ? Obligation.valueOf(o.name()) : null, (domain instanceof NumberRange<?>) ? (NumberRange<?>) domain : null, (domain instanceof Set<?>) ? (Set<?>) domain : null); } return null; }
/** * Returns a hash code value for this restriction. */ @Override public int hashCode() { int code = (int) serialVersionUID; if (obligation != null) { code ^= obligation.hashCode(); } if (range != null) { code ^= range.hashCode(); } if (validValues != null) { code ^= validValues.hashCode(); } return code; }
/** * Returns the wrapped value. * * @param wrapper the wrapper. * @return the wrapped value. */ @Override public final Obligation unmarshal(final MD_ObligationCode wrapper) { return Obligation.valueOf(name(wrapper.value)); }
/** * Returns a hash code value for this restriction. */ @Override public int hashCode() { int code = (int) serialVersionUID; if (obligation != null) { code ^= obligation.hashCode(); } if (range != null) { code ^= range.hashCode(); } if (validValues != null) { code ^= validValues.hashCode(); } return code; }
/** * Returns the programmatic name of this constant together with its {@linkplain #identifier() identifier}, if any. * * @since 3.1 */ @Override public String[] names() { return new String[] {name(), identifier}; }
/** * Returns all constants defined by this enumeration type. * Invoking this method is equivalent to invoking {@link #values()}, except that this * method can be invoked on an instance of the {@code ControlledVocabulary} interface * (i.e. the enumeration type does not need to be known at compile-time). * * @return all {@linkplain #values() values} for this enumeration. * * @since 3.1 */ @Override public Obligation[] family() { return values(); } }
/** * Returns a string representation of this restriction. */ @Override public String toString() { final StringBuilder buffer = new StringBuilder(Classes.getShortClassName(this)).append('['); String separator = ""; if (obligation != null) { buffer.append(obligation.name()); separator = ", "; } if (range != null) { buffer.append(separator).append("range=").append(range); separator = ", "; } if (validValues != null) { buffer.append(separator).append("validValues=").append(validValues); } return buffer.append(']').toString(); } }
/** * Returns a string representation of this restriction. */ @Override public String toString() { final StringBuilder buffer = new StringBuilder(Classes.getShortClassName(this)).append('['); String separator = ""; if (obligation != null) { buffer.append(obligation.name()); separator = ", "; } if (range != null) { buffer.append(separator).append("range=").append(range); separator = ", "; } if (validValues != null) { buffer.append(separator).append("validValues=").append(validValues); } return buffer.append(']').toString(); } }