Class Proxy<A>

Type Parameters:
A - the target type
All Implemented Interfaces:
Pattern<A>, Serializable, Cloneable
Direct Known Subclasses:
Lazy, Theme

@Generated(generator="eu.bandm.tools.expander", version="", timestamp="2026-01-12T17:56:31") public class Proxy<A> extends Unary<A,A>
Base class for patterns that contain one subpattern of the same target type. Methods have default implementations that delegate to the subpattern.

Subclasses may override methods to add behaviour.

See Also:
  • Constructor Details

    • Proxy

      protected Proxy(Pattern<? super A> body)
      Creates a new pattern.
      Parameters:
      body - the subpattern
    • Proxy

      protected Proxy()
      Creates a new pattern without a subpattern.
  • Method Details

    • match

      public boolean match(A target)
      Attempts to match this pattern against a given object.

      If the class of this pattern imposes a specific order on matches, the first one is chosen.

      The null target is generally allowed.

      The default implementation delegates to body.

      Parameters:
      target - the object to match against
      Returns:
      true if the matching is successful, false if it fails. Which Variables are bound by a successful or failed match depends.
      See Also: