Interface Value.Builder<T,B extends Value.Builder<T,B>>

Type Parameters:
T - the value type
B - the builder type
All Known Subinterfaces:
State.Builder, ValueList.Builder<T>, Values.Builder<T,C,B>, ValueSet.Builder<T>
Enclosing interface:
Value<T>

public static interface Value.Builder<T,B extends Value.Builder<T,B>>
Builds a Value instance.
  • Method Details

    • value

      B value(T value)
      Parameters:
      value - the initial value
      Returns:
      this builder instance
    • notify

      B notify(Value.Notify notify)
      Parameters:
      notify - the notify policy for this value, default Value.Notify.WHEN_CHANGED
      Returns:
      this builder instance
    • validator

      B validator(Value.Validator<? super T> validator)
      Adds a validator to the resulting value
      Parameters:
      validator - the validator to add
      Returns:
      this builder instance
    • link

      B link(Value<T> originalValue)
      Links the given value to the resulting value
      Parameters:
      originalValue - the original value to link
      Returns:
      this builder instance
      See Also:
    • link

      B link(ValueObserver<T> originalValue)
      Links the given value observer to the resulting value
      Parameters:
      originalValue - the value to link
      Returns:
      this builder instance
      See Also:
    • listener

      B listener(Runnable listener)
      Parameters:
      listener - a listener to add
      Returns:
      this builder instance
    • consumer

      B consumer(Consumer<? super T> consumer)
      Parameters:
      consumer - a consumer to add
      Returns:
      this builder instance
    • weakListener

      B weakListener(Runnable weakListener)
      Parameters:
      weakListener - a weak listener to add
      Returns:
      this builder instance
    • weakConsumer

      B weakConsumer(Consumer<? super T> weakConsumer)
      Parameters:
      weakConsumer - a weak consumer to add
      Returns:
      this builder instance
    • build

      Value<T> build()
      Returns:
      a new Value instance based on this builder