Package com.aerospike.dsl.parts.operand
Interface OperandFactory
public interface OperandFactory
A factory for creating different types of
AbstractPart operands based on a given value.
This factory provides a static method to dynamically create concrete operand implementations
such as StringOperand, BooleanOperand, FloatOperand, and IntOperand
from various Java primitive and wrapper types. It centralizes the logic for type-specific object creation.
- See Also:
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic AbstractPartcreateOperand(Object value) Creates a concreteAbstractPartoperand based on the type of the provided value.
-
Method Details
-
createOperand
Creates a concreteAbstractPartoperand based on the type of the provided value.This method handles the creation of operands for common data types:
StringtoStringOperand.BooleantoBooleanOperand.FloatorDoubletoFloatOperand.IntegerorLongtoIntOperand.
- Parameters:
value- The object to be converted into an operand. This cannot benull.- Returns:
- A new instance of an operand that extends
AbstractPart. - Throws:
IllegalArgumentException- If the value provided isnull.UnsupportedOperationException- If the type of the value is not supported by the factory.
-