Class WrapperProperty<T>

java.lang.Object
io.github.valentinherrmann.levenshtein.WrapperProperty<T>
Type Parameters:
T - the type of the property being wrapped

public class WrapperProperty<T> extends Object
A wrapper for properties of reflection elements that tracks expected vs. actual values and their existence state (exact match, deviation, missing, or unchecked). DEVIATES indicates a partial match or acceptable deviation which allows behavioral testing using this component. For names the acceptable deviation is set via LevenshteinSettings; for types it is based on assignability, numeric widening and primitive-wrapper equivalence.
  • Constructor Details

    • WrapperProperty

      public WrapperProperty(T expected)
      Constructs a new WrapperProperty with an expected value. The actual value is initialized to null and existence is set to UNCHECKED.
      Parameters:
      expected - the expected value of this property
  • Method Details

    • getExpected

      public T getExpected()
      Returns:
      the expected value
    • getActual

      public T getActual()
      Returns:
      the actual value found via reflection, or null if not (yet) found
    • getExistence

      public WrapperProperty.Existence getExistence()
      Returns:
      the existence state of this property
    • toString

      public String toString()
      Returns a string representation showing expected, actual, and existence state.
      Overrides:
      toString in class Object
      Returns:
      a formatted string with property details