Record Class JResolutionResult<I, O extends JType>

java.lang.Object
java.lang.Record
honeyroasted.jype.system.resolver.JResolutionResult<I,O>

public record JResolutionResult<I, O extends JType>(O extends JType value, String message, I lookup, Exception ex, List<JResolutionResult<?,?>> children) extends Record
  • Constructor Details

    • JResolutionResult

      public JResolutionResult(O value, I lookup, List<JResolutionResult<?,?>> children)
    • JResolutionResult

      public JResolutionResult(O value, I lookup)
    • JResolutionResult

      public JResolutionResult(String message, I lookup, Exception ex, List<JResolutionResult<?,?>> children)
    • JResolutionResult

      public JResolutionResult(String message, I lookup, Exception ex)
    • JResolutionResult

      public JResolutionResult(String message, I lookup, List<JResolutionResult<?,?>> children)
    • JResolutionResult

      public JResolutionResult(String message, I lookup)
    • JResolutionResult

      public JResolutionResult(O value, String message, I lookup, Exception ex, List<JResolutionResult<?,?>> children)
      Creates an instance of a JResolutionResult record class.
      Parameters:
      value - the value for the value record component
      message - the value for the message record component
      lookup - the value for the lookup record component
      ex - the value for the ex record component
      children - the value for the children record component
  • Method Details

    • inherit

      public static <T, V extends JType> JResolutionResult<T,V> inherit(T lookup, JResolutionResult<?, ? extends V> result, String failedMessage)
    • inherit

      public static <T, V extends JType> JResolutionResult<T,V> inherit(T lookup, JResolutionResult<?, ? extends V> result)
    • inherit

      public static <T, V extends JType> JResolutionResult<T,V> inherit(T lookup, List<? extends JResolutionResult<?, ? extends V>> result, String failedMessage)
    • inherit

      public static <T, V extends JType> JResolutionResult<T,V> inherit(T lookup, List<? extends JResolutionResult<?, ? extends V>> result)
    • inherit

      public static <T, V extends JType> JResolutionResult<T,V> inherit(V value, T lookup, List<? extends JResolutionResult<?,?>> result, String failedMessage)
    • inherit

      public static <T, V extends JType> JResolutionResult<T,V> inherit(V value, T lookup, List<? extends JResolutionResult<?,?>> result)
    • inherit

      public static <T, V extends JType> JResolutionResult<T,V> inherit(T lookup, Optional<? extends V> value, String failedMessage)
    • map

      public <T, V extends JType> JResolutionResult<T,V> map(Function<I,T> lookup, Function<O,V> mapper, String mappingFailed)
    • map

      public <T, V extends JType> JResolutionResult<T,V> map(T lookup, Function<O,V> mapper, String mappingFailed)
    • flatMap

      public <T, V extends JType> JResolutionResult<T,V> flatMap(Function<I,T> lookup, Function<O, Optional<V>> mapper, String mappingFailed)
    • flatMap

      public <T, V extends JType> JResolutionResult<T,V> flatMap(T lookup, Function<O, Optional<V>> mapper, String mappingFailed)
    • getOrThrow

      public O getOrThrow()
    • getOrDefault

      public O getOrDefault(O def)
    • success

      public boolean success()
    • failure

      public boolean failure()
    • toString

      public String toString(boolean includeSuccessChildren)
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • value

      public O value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • lookup

      public I lookup()
      Returns the value of the lookup record component.
      Returns:
      the value of the lookup record component
    • ex

      public Exception ex()
      Returns the value of the ex record component.
      Returns:
      the value of the ex record component
    • children

      public List<JResolutionResult<?,?>> children()
      Returns the value of the children record component.
      Returns:
      the value of the children record component