static <T> Keyword<T> keyword() { Declaration declaration = Declaration.declaration(); ParameterizedType parameterizedType = (ParameterizedType) declaration.type(); return Keyword.keyword( declaration.name(), Unchecked.<Class<T>>cast(parameterizedType.getActualTypeArguments()[0])); }
public static <K, V, M extends PersistentMap<K, V>> Pair<M, Option<V>> remove(M map, K key) { return Pair.pair(Unchecked.<M>cast(map.delete(key)), map.lookup(key)); }
public static <T> LogicalPredicate<T> in(final Iterable<? extends T> iterable) { if (Sequences.isEmpty(iterable)) return never(); return new InPredicate<T>(Unchecked.<Iterable<T>>cast(iterable)); }
public static <K, V, M extends PersistentMap<K, V>> Pair<M, Option<V>> put( M map, K key, V newValue) { return Pair.pair(Unchecked.<M>cast(map.insert(key, newValue)), map.lookup(key)); }
public Record call(final Record source) throws Exception { return keywords.fold( Record.constructors.record(), (record, keyword) -> record.set(Unchecked.<Keyword<Object>>cast(keyword), keyword.call(source))); }