@Override public Properties<T> set(V value, Properties<T> properties) { return key.set(value, properties); }
@Override public final V get(Properties<T> properties) { return key.get(properties); }
public BuildableKeyDecorator(Key<T, V> key, V builder) { super(key.name(), key); this.key = key; this.builder = builder; }
@Override public boolean test(Properties<T> properties) { for (Key<T, ?> key : keys) { if (!key.test(properties)) { return false; } } return true; }
@Override public <A2, E2 extends Exception> void accumulateIn(Serializer.Accumulator<A2, E2> iterableAccumulator) throws E2 { for (V value : iterable) { contents.accumulate(value, iterableAccumulator); } } });
@Override public boolean has(Key<T, ?> key) { return key.test(properties); }
@Override public final <A, E extends Exception> void accumulate(V value, Serializer.Accumulator<A, E> accumulator) throws E { for (Key<T, ?> key : keys) { @SuppressWarnings("unchecked") Key<T, Object> castKey = (Key<T, Object>) key; castKey.accumulate(value, accumulator); } }
@Override public final Properties<T> set(V value, Properties<T> properties) { return key.set(value, properties); } }
@Override public boolean test(Properties<T> properties) { return key.test(properties); }
@Override public V get(Properties<T> properties) { V value = underlyingKey.get(properties); if (value == null) { return defaultValue; } return value; }
private DefaultedKey(Key<T, V> underlyingKey, V defaultValue) { super(underlyingKey.name(), underlyingKey); this.underlyingKey = underlyingKey; this.defaultValue = defaultValue; }
public <A, E extends Exception> A into(Serializer.Accumulator<A, E> accumulator) throws E { for (Property<T, ?> property : rekord.properties()) { @SuppressWarnings("unchecked") Key<T, Object> castKey = (Key<T, Object>) property.key(); Object value = property.value(); castKey.accumulate(value, accumulator); } return accumulator.result(); } }
@Override public Properties<T> set(V value, Properties<T> properties) { return underlyingKey.set(value, properties); }
@Override public boolean test(Properties<T> properties) { return underlyingKey.test(properties); }
@Override public V get(Properties<T> properties) { return key.get(properties); }
@SuppressWarnings("unchecked") public <U> CopiedKey(Key<U, V> key) { super(key.name(), (Key<T, V>) key); }
@Override public <V> Rekord<T> with(Key<T, V> key, V value) { return set(key.set(value, properties)); }
@Override public final boolean test(Properties<T> properties) { return key.test(properties); }
@Override public <V> V get(Key<T, V> key) { return key.get(properties); }
public <T, V> UnacceptableKeyException(Key<T, V> key) { super(String.format(UnacceptableKeyTemplate, key.name())); } }