Class Transform<A,B>

Type Parameters:
A - the target type of the containing pattern
B - the target type of the contained subpattern
All Implemented Interfaces:
Pattern<A>, Serializable, Cloneable
Direct Known Subclasses:
RestrictedTransform, TotalTransform

@Generated(generator="eu.bandm.tools.expander", version="", timestamp="2026-01-12T17:56:31") public abstract class Transform<A,B> extends Unary<B,A>
Abstract base class for patterns that delegate transformed targets to a subpattern.

Subclasses must implement the Pattern.match(A) and the apply(A) method.

See Also:
  • Constructor Details

    • Transform

      protected Transform(Pattern<? super B> body)
      Creates a new instance.
      Parameters:
      body - the subpattern
  • Method Details

    • apply

      public abstract B apply(A target)
      Transforms a target to be matched into a target for the subpattern.
      Parameters:
      target - the target for this pattern to be matched against.
      Returns:
      a target for Unary.body to be matched against.