Record Class ResolutionContext

java.lang.Object
java.lang.Record
net.minecraft.network.chat.ResolutionContext

public record ResolutionContext(@Nullable CommandSourceStack source, @Nullable Entity defaultScoreboardEntity, Predicate<ObjectInfo> objectInfoValidator, int depthLimit, ResolutionContext.LimitBehavior depthLimitBehavior, int resolvedComponentLimit, org.apache.commons.lang3.mutable.MutableInt resolvedComponentCount) extends Record
  • Field Details

    • source

      private final @Nullable CommandSourceStack source
      The field for the source record component.
    • defaultScoreboardEntity

      private final @Nullable Entity defaultScoreboardEntity
      The field for the defaultScoreboardEntity record component.
    • objectInfoValidator

      private final Predicate<ObjectInfo> objectInfoValidator
      The field for the objectInfoValidator record component.
    • depthLimit

      private final int depthLimit
      The field for the depthLimit record component.
    • depthLimitBehavior

      private final ResolutionContext.LimitBehavior depthLimitBehavior
      The field for the depthLimitBehavior record component.
    • resolvedComponentLimit

      private final int resolvedComponentLimit
      The field for the resolvedComponentLimit record component.
    • resolvedComponentCount

      private final org.apache.commons.lang3.mutable.MutableInt resolvedComponentCount
      The field for the resolvedComponentCount record component.
    • DEFAULT_RESOLVED_COMPONENT_LIMIT

      private static final int DEFAULT_RESOLVED_COMPONENT_LIMIT
      See Also:
  • Constructor Details

    • ResolutionContext

      public ResolutionContext(@Nullable CommandSourceStack source, @Nullable Entity defaultScoreboardEntity, Predicate<ObjectInfo> objectInfoValidator, int depthLimit, ResolutionContext.LimitBehavior depthLimitBehavior, int resolvedComponentLimit, org.apache.commons.lang3.mutable.MutableInt resolvedComponentCount)
      Creates an instance of a ResolutionContext record class.
      Parameters:
      source - the value for the source record component
      defaultScoreboardEntity - the value for the defaultScoreboardEntity record component
      objectInfoValidator - the value for the objectInfoValidator record component
      depthLimit - the value for the depthLimit record component
      depthLimitBehavior - the value for the depthLimitBehavior record component
      resolvedComponentLimit - the value for the resolvedComponentLimit record component
      resolvedComponentCount - the value for the resolvedComponentCount record component
  • Method Details

    • validate

      public @Nullable ObjectInfo validate(ObjectInfo description)
    • create

      public static ResolutionContext create(CommandSourceStack source)
    • builder

      public static ResolutionContext.Builder builder()
    • toString

      public final 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • source

      public @Nullable CommandSourceStack source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • defaultScoreboardEntity

      public @Nullable Entity defaultScoreboardEntity()
      Returns the value of the defaultScoreboardEntity record component.
      Returns:
      the value of the defaultScoreboardEntity record component
    • objectInfoValidator

      public Predicate<ObjectInfo> objectInfoValidator()
      Returns the value of the objectInfoValidator record component.
      Returns:
      the value of the objectInfoValidator record component
    • depthLimit

      public int depthLimit()
      Returns the value of the depthLimit record component.
      Returns:
      the value of the depthLimit record component
    • depthLimitBehavior

      public ResolutionContext.LimitBehavior depthLimitBehavior()
      Returns the value of the depthLimitBehavior record component.
      Returns:
      the value of the depthLimitBehavior record component
    • resolvedComponentLimit

      public int resolvedComponentLimit()
      Returns the value of the resolvedComponentLimit record component.
      Returns:
      the value of the resolvedComponentLimit record component
    • resolvedComponentCount

      public org.apache.commons.lang3.mutable.MutableInt resolvedComponentCount()
      Returns the value of the resolvedComponentCount record component.
      Returns:
      the value of the resolvedComponentCount record component