Package moe.caramel.daydream.util
Record Class NumberRange<T extends Number>
java.lang.Object
java.lang.Record
moe.caramel.daydream.util.NumberRange<T>
- Type Parameters:
T
- 숫자 타입 (Integer, Double ...)
@NullMarked
public record NumberRange<T extends Number>(@Nullable T extends Number min, @Nullable T extends Number max)
extends Record
숫자 범위를 지정합니다.
-
Constructor Summary
ConstructorDescriptionNumberRange
(@Nullable T min, @Nullable T max) Creates an instance of aNumberRange
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.최댓값을 가져옵니다.최솟값을 가져옵니다.final int
hashCode()
Returns a hash code value for this object.max()
Returns the value of themax
record component.min()
Returns the value of themin
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
NumberRange
Creates an instance of aNumberRange
record class.- Parameters:
min
- the value for themin
record componentmax
- the value for themax
record component
-
-
Method Details
-
getMin
최솟값을 가져옵니다.- Parameters:
def
- 기본값- Returns:
- 최솟값
-
getMax
최댓값을 가져옵니다.- Parameters:
def
- 기본값- Returns:
- 최댓값
-
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)
. -
min
Returns the value of themin
record component.- Returns:
- the value of the
min
record component
-
max
Returns the value of themax
record component.- Returns:
- the value of the
max
record component
-