Interface StateSpec<StateT extends State>

Type Parameters:
StateT - The type of state being described.
All Superinterfaces:
Serializable

public interface StateSpec<StateT extends State> extends Serializable
A specification of a persistent state cell. This includes information necessary to encode the value and details about the intended access pattern.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Cases for doing a "switch" on the type of StateSpec.
  • Method Summary

    Modifier and Type
    Method
    Description
    bind(String id, StateBinder binder)
    For internal use only; no backwards-compatibility guarantees.
    void
    For internal use only; no backwards-compatibility guarantees.
    <ResultT> ResultT
    match(StateSpec.Cases<ResultT> cases)
    For internal use only; no backwards-compatibility guarantees.
    void
    offerCoders(Coder[] coders)
    For internal use only; no backwards-compatibility guarantees.
  • Method Details

    • bind

      @Internal StateT bind(String id, StateBinder binder)
      For internal use only; no backwards-compatibility guarantees.

      Use the binder to create an instance of StateT appropriate for this address.

    • match

      @Internal <ResultT> ResultT match(StateSpec.Cases<ResultT> cases)
      For internal use only; no backwards-compatibility guarantees.

      Perform case analysis on this StateSpec using the provided StateSpec.Cases.

    • offerCoders

      @Internal void offerCoders(Coder[] coders)
      For internal use only; no backwards-compatibility guarantees.

      Given {code coders} are inferred from type arguments defined for this class. Coders which are already set should take precedence over offered coders.

      Parameters:
      coders - Array of coders indexed by the type arguments order. Entries might be null if the coder could not be inferred.
    • finishSpecifying

      @Internal void finishSpecifying()
      For internal use only; no backwards-compatibility guarantees.

      Validates that this StateSpec has been specified correctly and finalizes it. Automatically invoked when the pipeline is built.