Record Class PrefabEntry

java.lang.Object
java.lang.Record
com.hypixel.hytale.server.core.prefab.PrefabEntry

public record PrefabEntry(@Nonnull Path path, @Nonnull Path relativePath, @Nullable AssetPack pack, @Nonnull String displayName) extends Record
  • Field Details

    • path

      @Nonnull private final Path path
      The field for the path record component.
    • relativePath

      @Nonnull private final Path relativePath
      The field for the relativePath record component.
    • pack

      @Nullable private final AssetPack pack
      The field for the pack record component.
    • displayName

      @Nonnull private final String displayName
      The field for the displayName record component.
  • Constructor Details

    • PrefabEntry

      public PrefabEntry(@Nonnull Path path, @Nonnull Path relativePath, @Nullable AssetPack pack)
    • PrefabEntry

      public PrefabEntry(@Nonnull Path path, @Nonnull Path relativePath, @Nullable AssetPack pack, @Nonnull String displayName)
      Creates an instance of a PrefabEntry record class.
      Parameters:
      path - the value for the path record component
      relativePath - the value for the relativePath record component
      pack - the value for the pack record component
      displayName - the value for the displayName record component
  • Method Details

    • isFromBasePack

      public boolean isFromBasePack()
    • isFromAssetPack

      public boolean isFromAssetPack()
    • getPackName

      @Nonnull public String getPackName()
    • getFileName

      @Nonnull public String getFileName()
    • getDisplayNameWithPack

      @Nonnull public String getDisplayNameWithPack()
    • buildDisplayName

      @Nonnull private static String buildDisplayName(@Nonnull Path relativePath, @Nullable AssetPack pack)
    • 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. 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.
    • path

      @Nonnull public Path path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • relativePath

      @Nonnull public Path relativePath()
      Returns the value of the relativePath record component.
      Returns:
      the value of the relativePath record component
    • pack

      @Nullable public AssetPack pack()
      Returns the value of the pack record component.
      Returns:
      the value of the pack record component
    • displayName

      @Nonnull public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component