Package hydra.extract.helpers
Interface Helpers
public interface Helpers
Helper functions for decoding terms to domain types
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T0,T1> Either<DecodingError, Either<T0, T1>> decodeEither(Function<Graph, Function<Term, Either<DecodingError, T0>>> leftDecoder, Function<Graph, Function<Term, Either<DecodingError, T1>>> rightDecoder, Graph g, Term term) static <T0> Either<DecodingError,List<T0>> decodeList(Function<Graph, Function<Term, Either<DecodingError, T0>>> elemDecoder, Graph g, Term term) static <T0,T1> Either<DecodingError, Map<T0, T1>> decodeMap(Function<Graph, Function<Term, Either<DecodingError, T0>>> keyDecoder, Function<Graph, Function<Term, Either<DecodingError, T1>>> valDecoder, Graph g, Term term) static <T0> Either<DecodingError,Maybe<T0>> decodeMaybe(Function<Graph, Function<Term, Either<DecodingError, T0>>> elemDecoder, Graph g, Term term) static <T0,T1> Either<DecodingError, Tuple.Tuple2<T0, T1>> decodePair(Function<Graph, Function<Term, Either<DecodingError, T0>>> firstDecoder, Function<Graph, Function<Term, Either<DecodingError, T1>>> secondDecoder, Graph g, Term term) static <T0> Either<DecodingError,Set<T0>> static Either<DecodingError,Void> decodeUnit(Graph g, Term term) static <T0> Either<DecodingError,T0> decodeWrapped(Function<Graph, Function<Term, Either<DecodingError, T0>>> bodyDecoder, Graph g, Term term) static <T0,T1, T2> Either<DecodingError, T2> requireField(String fieldName, Function<T0, Function<T1, Either<DecodingError, T2>>> decoder, Map<Name, T1> fieldMap, T0 g) toFieldMap(Record record)
-
Method Details
-
decodeEither
-
decodeList
-
decodeMap
-
decodeMaybe
-
decodePair
static <T0,T1> Either<DecodingError,Tuple.Tuple2<T0, decodePairT1>> (Function<Graph, Function<Term, Either<DecodingError, T0>>> firstDecoder, Function<Graph, Function<Term, Either<DecodingError, T1>>> secondDecoder, Graph g, Term term) -
decodeSet
-
decodeUnit
-
decodeWrapped
static <T0> Either<DecodingError,T0> decodeWrapped(Function<Graph, Function<Term, Either<DecodingError, T0>>> bodyDecoder, Graph g, Term term) -
requireField
static <T0,T1, Either<DecodingError,T2> T2> requireField(String fieldName, Function<T0, Function<T1, Either<DecodingError, T2>>> decoder, Map<Name, T1> fieldMap, T0 g) -
toFieldMap
-