Record Class Mirror

java.lang.Object
java.lang.Record
io.github.slimjar.resolver.data.Mirror
All Implemented Interfaces:
Serializable

public record Mirror(@NotNull URL mirroring, @NotNull URL original) extends Record implements Serializable
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Mirror(@NotNull URL mirroring, @NotNull URL original)
    Creates an instance of a Mirror record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(@Nullable Object o)
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull URL
    Returns the value of the mirroring record component.
    @NotNull URL
    Returns the value of the original record component.
    static @NotNull Mirror
    read(@NotNull DataInput in)
     
    @NotNull String
    Returns a string representation of this record class.
    void
    write(@NotNull DataOutput out)
     

    Methods inherited from class java.lang.Object

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

    • Mirror

      public Mirror(@NotNull @NotNull URL mirroring, @NotNull @NotNull URL original)
      Creates an instance of a Mirror record class.
      Parameters:
      mirroring - the value for the mirroring record component
      original - the value for the original record component
  • Method Details

    • read

      @NotNull @Contract(pure=true) public static @NotNull Mirror read(@NotNull @NotNull DataInput in) throws IOException
      Throws:
      IOException
    • write

      public void write(@NotNull @NotNull DataOutput out) throws IOException
      Throws:
      IOException
    • toString

      @Contract(pure=true) @NotNull public @NotNull 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
    • equals

      @Contract(value="null -> false", pure=true) public boolean equals(@Nullable @Nullable 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.
    • 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
    • mirroring

      @NotNull public @NotNull URL mirroring()
      Returns the value of the mirroring record component.
      Returns:
      the value of the mirroring record component
    • original

      @NotNull public @NotNull URL original()
      Returns the value of the original record component.
      Returns:
      the value of the original record component