Record Class GuiAnchorPlacement

java.lang.Object
java.lang.Record
com.render.api.gui.layout.GuiAnchorPlacement
Record Components:
anchorName - referenced anchor name
area - preferred area
fallbacks - fallback areas in trial order
offsetX - additional horizontal offset
offsetY - additional vertical offset
hideWhenMissing - whether the positioned box is hidden when the anchor is absent

public record GuiAnchorPlacement(String anchorName, GuiPositionArea area, List<GuiPositionArea> fallbacks, GuiLength offsetX, GuiLength offsetY, boolean hideWhenMissing) extends Record
Anchor-position request with ordered fallback areas.
  • Constructor Details

    • GuiAnchorPlacement

      public GuiAnchorPlacement(String anchorName, GuiPositionArea area, List<GuiPositionArea> fallbacks, GuiLength offsetX, GuiLength offsetY, boolean hideWhenMissing)
      Creates an instance of a GuiAnchorPlacement record class.
      Parameters:
      anchorName - the value for the anchorName record component
      area - the value for the area record component
      fallbacks - the value for the fallbacks record component
      offsetX - the value for the offsetX record component
      offsetY - the value for the offsetY record component
      hideWhenMissing - the value for the hideWhenMissing record component
  • Method Details

    • of

      public static GuiAnchorPlacement of(String anchorName, GuiPositionArea area)
    • withFallbacks

      public GuiAnchorPlacement withFallbacks(GuiPositionArea... areas)
    • withOffset

      public GuiAnchorPlacement withOffset(GuiLength x, GuiLength y)
    • hideWhenMissing

      public GuiAnchorPlacement hideWhenMissing(boolean hide)
    • 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.
    • anchorName

      public String anchorName()
      Returns the value of the anchorName record component.
      Returns:
      the value of the anchorName record component
    • area

      public GuiPositionArea area()
      Returns the value of the area record component.
      Returns:
      the value of the area record component
    • fallbacks

      public List<GuiPositionArea> fallbacks()
      Returns the value of the fallbacks record component.
      Returns:
      the value of the fallbacks record component
    • offsetX

      public GuiLength offsetX()
      Returns the value of the offsetX record component.
      Returns:
      the value of the offsetX record component
    • offsetY

      public GuiLength offsetY()
      Returns the value of the offsetY record component.
      Returns:
      the value of the offsetY record component
    • hideWhenMissing

      public boolean hideWhenMissing()
      Returns the value of the hideWhenMissing record component.
      Returns:
      the value of the hideWhenMissing record component