Package net.nullved.pmweatherapi.util
Record Class StringValue
java.lang.Object
java.lang.Record
net.nullved.pmweatherapi.util.StringValue
- Record Components:
value- TheStringto store.
- All Implemented Interfaces:
Comparable<StringValue>,net.minecraft.util.StringRepresentable
public record StringValue(String value)
extends Record
implements net.minecraft.util.StringRepresentable, Comparable<StringValue>
An immutable wrapper around
Strings that can be used with StringProperty.- Since:
- 0.14.15.6
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.util.StringRepresentable
net.minecraft.util.StringRepresentable.EnumCodec<E extends Enum<E> & net.minecraft.util.StringRepresentable>, net.minecraft.util.StringRepresentable.StringRepresentableCodec<S extends net.minecraft.util.StringRepresentable> -
Field Summary
Fields inherited from interface net.minecraft.util.StringRepresentable
PRE_BUILT_MAP_THRESHOLD -
Constructor Summary
ConstructorsConstructorDescriptionStringValue(String value) Creates an instance of aStringValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull StringValue o) Compares thisStringValue's value to anotherStringValue's valuefinal booleanIndicates whether some other object is "equal to" this one.Gets the serialized valuefinal inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
StringValue
Creates an instance of aStringValuerecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
getSerializedName
Gets the serialized value- Specified by:
getSerializedNamein interfacenet.minecraft.util.StringRepresentable- Returns:
- The value
- Since:
- 0.14.15.6
-
compareTo
Compares thisStringValue's value to anotherStringValue's value- Specified by:
compareToin interfaceComparable<StringValue>- Parameters:
o- The otherStringValue- Returns:
- 0 if the strings are equal, 1 if this string is greater, -1 if less than the other
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-