Record Class UploadInfo

java.lang.Object
java.lang.Record
com.mojang.realmsclient.dto.UploadInfo

public record UploadInfo(boolean worldClosed, @Nullable String token, URI uploadEndpoint) extends Record
  • Field Details

    • worldClosed

      private final boolean worldClosed
      The field for the worldClosed record component.
    • token

      private final @Nullable String token
      The field for the token record component.
    • uploadEndpoint

      private final URI uploadEndpoint
      The field for the uploadEndpoint record component.
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • DEFAULT_SCHEMA

      private static final String DEFAULT_SCHEMA
      See Also:
    • DEFAULT_PORT

      private static final int DEFAULT_PORT
      See Also:
    • URI_SCHEMA_PATTERN

      private static final Pattern URI_SCHEMA_PATTERN
  • Constructor Details

    • UploadInfo

      public UploadInfo(boolean worldClosed, @Nullable String token, URI uploadEndpoint)
      Creates an instance of a UploadInfo record class.
      Parameters:
      worldClosed - the value for the worldClosed record component
      token - the value for the token record component
      uploadEndpoint - the value for the uploadEndpoint record component
  • Method Details

    • parse

      public static @Nullable UploadInfo parse(String json)
    • assembleUri

      public static @Nullable URI assembleUri(String endpoint, int portOverride)
    • selectPortOrDefault

      private static int selectPortOrDefault(int portOverride, int parsedPort)
    • ensureEndpointSchema

      private static String ensureEndpointSchema(String endpoint, Matcher matcher)
    • createRequest

      public static String createRequest(@Nullable String uploadToken)
    • 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.
    • worldClosed

      public boolean worldClosed()
      Returns the value of the worldClosed record component.
      Returns:
      the value of the worldClosed record component
    • token

      public @Nullable String token()
      Returns the value of the token record component.
      Returns:
      the value of the token record component
    • uploadEndpoint

      public URI uploadEndpoint()
      Returns the value of the uploadEndpoint record component.
      Returns:
      the value of the uploadEndpoint record component