java.lang.Object
io.fluxcapacitor.javaclient.common.serialization.casting.AnnotatedCaster<T>
Type Parameters:
T - the underlying type of the serialized data

public class AnnotatedCaster<T> extends Object
Represents a dynamically discovered casting method (annotated with Upcast or Downcast) that is bound to a specific data revision and type.

This class delegates casting logic to a functional wrapper around the annotated method, and is typically instantiated by CastInspector as part of building a CasterChain.

  • Constructor Details

  • Method Details

    • cast

      public <S extends SerializedObject<T>> Stream<S> cast(S input)
      Applies the casting logic to the given serialized object if its type and revision match this caster’s parameters. If the input does not match, it is returned unmodified.
      Type Parameters:
      S - the input and output serialized object type
      Parameters:
      input - the serialized object to potentially cast
      Returns:
      a stream containing the casted result(s) or the original input if no match was found
    • toString

      public String toString()
      Overrides:
      toString in class Object