Record Class OperationInfo<L,R,T>
java.lang.Object
java.lang.Record
org.skriptlang.skript.lang.arithmetic.OperationInfo<L,R,T>
- Type Parameters:
L- type of the left operandR- type of the right operandT- return type of the operation- Record Components:
left- type of the left operandright- type of the right operandreturnType- return type of the operationoperation-Operationthat performs the actual calculation
public record OperationInfo<L,R,T> (Class<L> left, Class<R> right, Class<T> returnType, Operation<L,R,T> operation)
extends Record
Represents a binary operation including information about the types of its
operands and its return type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.<L2,R2> @Nullable OperationInfo <L2, R2, T> getConverted(Class<L2> fromLeft, Class<R2> fromRight) Attempts to create a newOperationInfothat accepts operands of typesfromLeftandfromRight, while maintaining the original return type and calculation of this operation info.<L2,R2, T2>
@Nullable OperationInfo<L2, R2, T2> getConverted(Class<L2> fromLeft, Class<R2> fromRight, Class<T2> toReturnType) Attempts to create a newOperationInfothat accepts operands of typesfromLeftandfromRight, and returnstoReturnType, while maintaining the calculation of this operation info.getLeft()Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.getRight()Deprecated, for removal: This API element is subject to removal in a future version.final inthashCode()Returns a hash code value for this object.left()Returns the value of theleftrecord component.Returns the value of theoperationrecord component.Returns the value of thereturnTyperecord component.right()Returns the value of therightrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
OperationInfo
public OperationInfo(@NotNull @NotNull Class<L> left, @NotNull @NotNull Class<R> right, @NotNull @NotNull Class<T> returnType, @NotNull @NotNull Operation<L, R, T> operation) Creates an instance of aOperationInforecord class.- Parameters:
left- the value for theleftrecord componentright- the value for therightrecord componentreturnType- the value for thereturnTyperecord componentoperation- the value for theoperationrecord component
-
-
Method Details
-
getLeft
Deprecated, for removal: This API element is subject to removal in a future version. -
getRight
Deprecated, for removal: This API element is subject to removal in a future version. -
getReturnType
Deprecated, for removal: This API element is subject to removal in a future version. -
getOperation
Deprecated, for removal: This API element is subject to removal in a future version. -
getConverted
@Nullable public <L2,R2> @Nullable OperationInfo<L2,R2, getConvertedT> (Class<L2> fromLeft, Class<R2> fromRight) Attempts to create a newOperationInfothat accepts operands of typesfromLeftandfromRight, while maintaining the original return type and calculation of this operation info.- Type Parameters:
L2- type of the new left operandR2- type of the new right operand- Parameters:
fromLeft- type for the new left operandfromRight- type for the new right operand- Returns:
- new
OperationInfocapable of handling the specified input types if converters for them exist, else null
-
getConverted
@Nullable public <L2,R2, @Nullable OperationInfo<L2,T2> R2, getConvertedT2> (Class<L2> fromLeft, Class<R2> fromRight, Class<T2> toReturnType) Attempts to create a newOperationInfothat accepts operands of typesfromLeftandfromRight, and returnstoReturnType, while maintaining the calculation of this operation info.- Type Parameters:
L2- type of the new left operandR2- type of the new right operand- Parameters:
fromLeft- type for the new left operandfromRight- type for the new right operandtoReturnType- new return type- Returns:
- new
OperationInfocapable of handling the specified input types and return type if converters for them exist, else null
-
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). -
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-
returnType
Returns the value of thereturnTyperecord component.- Returns:
- the value of the
returnTyperecord component
-
operation
Returns the value of theoperationrecord component.- Returns:
- the value of the
operationrecord component
-