Record Class Repository

java.lang.Object
java.lang.Record
io.github.slimjar.resolver.data.Repository

public record Repository(@NotNull URL url) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final @NotNull String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Repository(@NotNull URL url)
    Creates an instance of a Repository record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull Repository
     
    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.
    static Repository
    read(@NotNull DataInput in)
     
    @NotNull String
    Returns a string representation of this record class.
    @NotNull URL
    url()
    Returns the value of the url record component.
    void
    write(@NotNull DataOutput out)
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • Repository

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

    • central

      @NotNull public static @NotNull Repository central()
    • read

      public static Repository read(@NotNull @NotNull DataInput in) throws IOException
      Throws:
      IOException
    • write

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

      @Contract(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.
    • 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
    • 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
    • url

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