Package sprouts.impl
Interface SproutsFactory
- All Known Implementing Classes:
Sprouts
public interface SproutsFactory
Creates instances of the various property types in the Sprouts library.
This interface allows you to plug in your own implementations of the Sprouts properties
through the
Sprouts.setFactory(SproutsFactory)
method.-
Method Summary
Modifier and TypeMethodDescription<O,
D> WeakAction <O, D> actionOfWeak
(O owner, BiConsumer<O, D> action) <K,
V> Association <K, V> associationOf
(Class<K> keyType, Class<V> valueType) The default channel used for change events.The default id for properties which do not have an id explicitly specified.The default channel used forObservable
events, registered through theObservable.subscribe(Observer)
method.<T> ValDelegate
<T> delegateOf
(Val<T> source, Channel channel, SingleChange change, @Nullable T newValue, @Nullable T oldValue) <T> ValsDelegate
<T> delegateOf
(Vals<T> source, SequenceChange changeType, int index, Vals<T> newValues, Vals<T> oldValues) event()
eventOf
(Event.Executor executor) The regexPattern
used to validate property ids.lensOfNullable
(Class<B> type, Var<T> source, Lens<T, B> lens) default <T> Maybe
<T> default <T> Maybe
<T> maybeOf
(T item) default <T> Maybe
<@Nullable T> maybeOfNull
(Class<T> type) default <T> Maybe
<@Nullable T> maybeOfNullable
(Class<T> type, @Nullable T item) maybeOfNullable
(Maybe<T> toBeCopied) <O> WeakObserver
<O> observerOfWeak
(O owner, Consumer<O> action) <V> Result
<V> <V> Result
<V> <V> Result
<V> <V> Result
<V> <V> Result
<V> <V> Result
<V> <V> Result
<V> resultOf
(V value) <V> Result
<V> resultOfList
(Class<V> type, List<V> list) resultOfList
(Class<V> type, List<V> list, Iterable<Problem> problems) resultOfList
(Class<V> type, Problem problem) <V> Result
<V> resultOfTry
(Class<V> type, Supplier<V> supplier) <T> Tuple
<T> <T> Tuple
<T> <T> Tuple
<T> <T> Tuple
<T> <T> Tuple
<T> <T> Tuple
<T> tupleOf
(T first, T... rest) <T> Tuple
<@Nullable T> tupleOfNullable
(Class<T> type) <T> Tuple
<@Nullable T> tupleOfNullable
(Class<T> type, @Nullable T... values) <T> Tuple
<@Nullable T> tupleOfNullable
(Class<T> type, Iterable<@Nullable T> iterable) <T> Tuple
<@Nullable T> tupleOfNullable
(Class<T> type, Maybe<@Nullable T>... vars) <T> Tuple
<@Nullable T> tupleOfNullable
(Maybe<@Nullable T> first, Maybe<@Nullable T>... rest) <T> Val
<T> <T> Val
<T> valOf
(T item) <T> Val
<@Nullable T> <T> Val
<@Nullable T> valOfNullable
(Class<T> type, @Nullable T item) valOfNullable
(Val<T> toBeCopied) <T> Vals
<T> <T> Vals
<T> <T> Vals
<T> <T> Vals
<T> <T> Vals
<T> <T> Vals
<T> <T> Vals
<T> valsOf
(T first, T... rest) <T> Vals
<@Nullable T> valsOfNullable
(Class<T> type) <T> Vals
<@Nullable T> valsOfNullable
(Class<T> type, @Nullable T... items) <T> Vals
<@Nullable T> valsOfNullable
(Class<T> type, Val<@Nullable T>... vals) <T> Vals
<@Nullable T> valsOfNullable
(Class<T> type, Vals<@Nullable T> vals) <T> Vals
<@Nullable T> valsOfNullable
(Val<@Nullable T> first, Val<@Nullable T>... rest) <T,
V extends T>
Var<T> <T> Var
<T> varOf
(T item) <T> Var
<@Nullable T> <T> Var
<@Nullable T> varOfNullable
(Class<T> type, @Nullable T item) <T> Vars
<T> <T> Vars
<T> <T> Vars
<T> <T> Vars
<T> <T> Vars
<T> <T> Vars
<T> varsOf
(T first, T... rest) <T> Vars
<@Nullable T> varsOfNullable
(Class<T> type) <T> Vars
<@Nullable T> varsOfNullable
(Class<T> type, @Nullable T... values) <T> Vars
<@Nullable T> varsOfNullable
(Class<T> type, Iterable<Var<@Nullable T>> vars) <T> Vars
<@Nullable T> varsOfNullable
(Class<T> type, Var<@Nullable T>... vars) <T> Vars
<@Nullable T> varsOfNullable
(Var<@Nullable T> first, Var<@Nullable T>... rest) viewOf
(Class<R> type, Val<T> first, Val<U> second, BiFunction<T, U, R> combiner) viewOf
(Val<T> first, Val<U> second, BiFunction<T, U, @NonNull T> combiner) viewOfNullable
(Class<R> type, Val<T> first, Val<U> second, BiFunction<T, U, @Nullable R> combiner) viewOfNullable
(Class<U> type, Val<T> source, Function<T, @Nullable U> mapper) viewOfNullable
(Val<T> first, Val<U> second, BiFunction<T, U, @Nullable T> combiner)
-
Method Details
-
delegateOf
<T> ValDelegate<T> delegateOf(Val<T> source, Channel channel, SingleChange change, @Nullable T newValue, @Nullable T oldValue) -
delegateOf
<T> ValsDelegate<T> delegateOf(Vals<T> source, SequenceChange changeType, int index, Vals<T> newValues, Vals<T> oldValues) -
event
Event event() -
eventOf
-
maybeOfNullable
-
maybeOfNull
-
maybeOf
-
maybeOf
-
maybeOfNullable
-
valOfNullable
-
valOfNull
-
valOf
-
valOf
-
valOfNullable
-
viewOf
-
viewOf
-
viewOfNullable
-
viewOf
-
viewOfNullable
-
viewOf
-
viewOf
-
viewOf
-
viewOf
-
viewOfNullable
-
lensOf
-
lensOf
-
lensOfNullable
-
varOfNullable
-
varOfNull
-
varOf
-
varOf
-
valsOf
-
valsOf
-
valsOf
-
valsOf
-
valsOf
-
valsOf
-
valsOf
-
valsOfNullable
-
valsOfNullable
-
valsOfNullable
-
valsOfNullable
-
valsOfNullable
-
varsOf
-
varsOf
-
varsOf
-
varsOf
-
varsOf
-
varsOf
-
varsOfNullable
-
varsOfNullable
-
varsOfNullable
-
varsOfNullable
-
varsOfNullable
-
tupleOf
-
tupleOf
-
tupleOf
-
tupleOf
-
tupleOf
-
tupleOf
-
tupleOfNullable
-
tupleOfNullable
-
tupleOfNullable
-
tupleOfNullable
-
tupleOfNullable
-
associationOf
-
resultOf
-
resultOf
-
resultOf
-
resultOf
-
resultOf
-
resultOf
-
resultOf
-
resultOf
-
resultOfList
-
resultOfList
-
resultOfList
-
resultOfTry
-
actionOfWeak
-
observerOfWeak
-
defaultId
String defaultId()The default id for properties which do not have an id explicitly specified. The id of a property is used to identify it in the system or as part of a view model and convert it into other data formats like key/value based data stores.- Returns:
- The default id for properties which do not have an id explicitly specified.
This must never return
null
and it is recommended to be a constant or cached object due to this method being called frequently.
-
idPattern
Pattern idPattern()The regexPattern
used to validate property ids. All ids must match this pattern.- Returns:
- The regex
Pattern
used to validate property ids. This must never returnnull
and it is recommended to be a constant or cached object due to this method being called frequently.
-
defaultChannel
Channel defaultChannel()The default channel used for change events. This channel is used to give events a chanel when no channel is explicitly specified.- Returns:
- The default channel used for change events.
This must never return
null
and it is recommended to be a constant or cached object due to this method being called frequently.
-
defaultObservableChannel
Channel defaultObservableChannel()The default channel used forObservable
events, registered through theObservable.subscribe(Observer)
method.- Returns:
- The default channel used for change events.
This must never return
null
and it is recommended to be a constant or cached object due to this method being called frequently.
-