Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.noodlesandwich.rekord.keys;
 
 
 public final class IterableKey<T, V, C extends Iterable<V>> extends OriginalKey<T, C> {
     private final Key<T, V> contents;
 
    private IterableKey(String nameKey<T, V> contents) {
        super(name);
        this. = contents;
    }
    public static IterableKeyBuilder named(String name) {
        return new IterableKeyBuilder(name);
    }
    public static final class IterableKeyBuilder {
        private final String name;
        public IterableKeyBuilder(String name) {
            this. = name;
        }
        public <T, V, C extends Iterable<V>> Key<T, C> of(Key<T, V> contents) {
            return new IterableKey<>(contents);
        }
    }
    @Override
    public <A, E extends Exceptionvoid accumulate(final C iterableSerializer.Accumulator<A, E> accumulatorthrows E {
        accumulator.addIterable(name(), new Serializer.Accumulation() {
            @Override
            public <A2, E2 extends Exceptionvoid accumulateIn(Serializer.Accumulator<A2, E2> iterableAccumulatorthrows E2 {
                Serialization.serialize(iterable).with().into(iterableAccumulator);
            }
        });
    }
New to GrepCode? Check out our FAQ X