Record Class Monitor

java.lang.Object
java.lang.Record
com.mojang.blaze3d.platform.Monitor

public record Monitor(String name, int id, List<VideoMode> videoModes, VideoMode currentMode, int x, int y, int w, int h) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final VideoMode
    The field for the currentMode record component.
    private final int
    The field for the h record component.
    private static final HexFormat
     
    private final int
    The field for the id record component.
    private static final org.slf4j.Logger
     
    private final String
    The field for the name record component.
    private final List<VideoMode>
    The field for the videoModes record component.
    private final int
    The field for the w record component.
    private final int
    The field for the x record component.
    private final int
    The field for the y record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Monitor(String name, int id, List<VideoMode> videoModes, VideoMode currentMode, int x, int y, int w, int h)
    Creates an instance of a Monitor record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the currentMode record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
     
    int
    h()
    Returns the value of the h record component.
    final int
    Returns a hash code value for this object.
    int
    id()
    Returns the value of the id record component.
    int
    indexOfMode(VideoMode expectedMode)
     
    mode(int mode)
     
    int
     
    Returns the value of the name record component.
    private static String
     
    Returns a string representation of this record class.
    tryCreate(int id)
     
    Returns the value of the videoModes record component.
    int
    w()
    Returns the value of the w record component.
    int
    x()
    Returns the value of the x record component.
    int
    y()
    Returns the value of the y record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      private final String name
      The field for the name record component.
    • id

      private final int id
      The field for the id record component.
    • videoModes

      private final List<VideoMode> videoModes
      The field for the videoModes record component.
    • currentMode

      private final VideoMode currentMode
      The field for the currentMode record component.
    • x

      private final int x
      The field for the x record component.
    • y

      private final int y
      The field for the y record component.
    • w

      private final int w
      The field for the w record component.
    • h

      private final int h
      The field for the h record component.
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • HEX_FORMAT

      private static final HexFormat HEX_FORMAT
  • Constructor Details

    • Monitor

      public Monitor(String name, int id, List<VideoMode> videoModes, VideoMode currentMode, int x, int y, int w, int h)
      Creates an instance of a Monitor record class.
      Parameters:
      name - the value for the name record component
      id - the value for the id record component
      videoModes - the value for the videoModes record component
      currentMode - the value for the currentMode record component
      x - the value for the x record component
      y - the value for the y record component
      w - the value for the w record component
      h - the value for the h record component
  • Method Details

    • tryCreate

      public static @Nullable Monitor tryCreate(int id)
    • queryMonitorName

      private static String queryMonitorName(int id)
    • getPreferredVideoMode

      public VideoMode getPreferredVideoMode(Optional<VideoMode> expectedMode)
    • indexOfMode

      public int indexOfMode(VideoMode expectedMode)
    • mode

      public VideoMode mode(int mode)
    • modeCount

      public int modeCount()
    • 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. 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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • videoModes

      public List<VideoMode> videoModes()
      Returns the value of the videoModes record component.
      Returns:
      the value of the videoModes record component
    • currentMode

      public VideoMode currentMode()
      Returns the value of the currentMode record component.
      Returns:
      the value of the currentMode record component
    • x

      public int x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public int y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • w

      public int w()
      Returns the value of the w record component.
      Returns:
      the value of the w record component
    • h

      public int h()
      Returns the value of the h record component.
      Returns:
      the value of the h record component