@Override public <T> T queryValueOrNull(ReferenceDataId<T> id) { T value1 = refData1.queryValueOrNull(id); return value1 != null ? value1 : refData2.queryValueOrNull(id); }
/** * Returns a suitable hash code for the identifier. * * @return the hash code */ @Override public int hashCode() { return standardId.hashCode() + 7; }
/** * Obtains an instance containing no reference data. * * @return empty reference data */ public static ReferenceData empty() { return ImmutableReferenceData.empty(); }
@Override public ReferenceData getReferenceData() { return ReferenceData.standard(); } };
@Override public StandardId getStandardId() { return StandardId.of("Test", id); }
@Override public boolean containsValue(ReferenceDataId<?> id) { return refData1.containsValue(id) || refData2.containsValue(id); }
/** * Combines this reference data with another. * <p> * The result combines both sets of reference data. * Values are taken from this set of reference data if available, otherwise they are taken * from the other set. * * @param other the other reference data * @return the combined reference data */ public default ReferenceData combinedWith(ReferenceData other) { return new CombinedReferenceData(this, other); }
@Override public StandardId build() { return new StandardId( scheme, value); }
@Override public ImmutableReferenceData build() { return new ImmutableReferenceData( values); }
/** * Checks if this reference data contains a value for the specified identifier. * * @param id the identifier to find * @return true if the reference data contains a value for the identifier */ public default boolean containsValue(ReferenceDataId<?> id) { return id.queryValueOrNull(this) != null; }
@Override public BeanBuilder<? extends StandardId> builder() { return new StandardId.Builder(); }
@Override public BeanBuilder<? extends ImmutableReferenceData> builder() { return new ImmutableReferenceData.Builder(); }
/** * Create an {@code Assert} instance for the supplied {@code CurrencyAmount}. * * @param amount the amount to create an {@code Assert} for * @return an {@code Assert} instance */ public static CurrencyAmountAssert assertThat(CurrencyAmount amount) { return new CurrencyAmountAssert(amount); }
/** * Create an {@code Assert} instance that enables * assertions on {@code CurrencyAmount} objects. * * @param amount the amount to create an {@code Assert} for * @return an {@code Assert} instance */ public static CurrencyAmountAssert assertThat(CurrencyAmount amount) { return CurrencyAmountAssert.assertThat(amount); } }
@Override public ReferenceData getReferenceData() { return ReferenceData.standard(); } };
@Override public boolean containsValue(ReferenceDataId<?> id) { return underlying.queryValueOrNull(id) != null || id instanceof HolidayCalendarId; }
/** * Returns a suitable hash code for the identifier. * * @return the hash code */ @Override public int hashCode() { return standardId.hashCode() + 7; }
@Override public ReferenceData getReferenceData() { return ReferenceData.standard(); } };
/** * Low-level method to query the reference data value associated with this identifier, * returning null if not found. * <p> * This is a low-level method that obtains the reference data value, returning null instead of an error. * Applications should use {@link ReferenceData#getValue(ReferenceDataId)} in preference to this method. * * @param refData the reference data to lookup the value in * @return the reference data value, null if not found */ public default T queryValueOrNull(ReferenceData refData) { return refData.queryValueOrNull(this); }
/** * Returns a suitable hash code for the identifier. * * @return the hash code */ @Override public int hashCode() { return standardId.hashCode() + 7; }