/** * Obtains the element at the given index. * * @param <T> Element type. * @param elementIndex The element index. * @return The element, cast to {@code T}. */ protected final <T> T get(int elementIndex) { return Classes.cast(elements[elementIndex]); }
public <T> T getObjective() { return Classes.cast(objective); }
public <T> T getResult() { return Classes.cast(result); }
public static <A, B, C> Triple<A, B, C> empty() { return Classes.cast(EMPTY); }
private O self() { return Classes.cast(this); }
public <T> T getMetadata() { return Classes.cast(metadata); }
public <T> T getObjective() { return Classes.cast(objective); }
static <T> FieldPatch<T> ofNull() { return Classes.cast(NULL_INSTANCE); }
private M self() { return Classes.cast(this); } }
TypedFieldPatchDeserializer(Class<?> valueType) { super(Classes.<Class<FieldPatch<?>>>cast(FieldPatch.class)); this.valueType = valueType; }
public static <A, B, C, D> Quadruple<A, B, C, D> empty() { return Classes.cast(EMPTY); }
public <T> T getMetadata() { return Classes.cast(metadata); }
public static <A, B> Pair<A, B> empty() { return Classes.cast(EMPTY); }
public <T> T getResult() { return Classes.cast(result); }
public <T> T getEvent() { return Classes.cast(event); }
public <T> T getObjective() { return Classes.cast(objective); }
StandardFieldPatchDeserializer() { super(Classes.<Class<StandardFieldPatch<?>>>cast(StandardFieldPatch.class)); }
StandardFieldPatchSerializer() { super(Classes.<Class<StandardFieldPatch<?>>>cast(StandardFieldPatch.class)); }
/** * Assigns a {@link Supplier} for a given class {@code type}, to be returned for all * future invocations of {@link ScopedResolver#lookup}. * * @param <T> Value type. * @param type The class type. * @param supplier The supplier for the mapped {@code type}. * @return The previously assigned {@link Supplier}, or {@code null} if this mapping was * not assigned. */ public <T> T assign(Class<T> type, Supplier<? extends T> supplier) { return Classes.cast(map.put(type, Classes.cast(supplier))); }
/** * Resets the mapping for the given {@code type}, leaving it in an unassigned state. * * @param <T> Value type. * @param type The class type. * @return The previously assigned {@link Supplier}, or {@code null} if this mapping was * not assigned. */ public <T> Supplier<T> reset(Class<T> type) { return Classes.cast(map.remove(type)); } }