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
ConstructorsConstructorDescriptionNumberRange(@Nullable T min, @Nullable T max) Creates an instance of aNumberRangerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.최댓값을 가져옵니다.최솟값을 가져옵니다.final inthashCode()Returns a hash code value for this object.max()Returns the value of themaxrecord component.min()Returns the value of theminrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NumberRange
Creates an instance of aNumberRangerecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord 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 theminrecord component.- Returns:
- the value of the
minrecord component
-
max
Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-