Package com.darkcollective.relix.symbol
Record Class ParameterDefinition
java.lang.Object
java.lang.Record
com.darkcollective.relix.symbol.ParameterDefinition
- Record Components:
name- the parameter name as declared; must not be blanktype- the scalar type of this parameter;ScalarType.ANYfor a relation parameter; must not be nullheading- the columns of a relation parameter; empty for a scalar one; must not be null
public record ParameterDefinition(String name, ScalarType type, Optional<Schema> heading)
extends Record
A single parameter in a function signature: a scalar, or — for a table-valued
function only — a relation.
A scalar parameter has a type() and no heading(). A
relation parameter (E: RELATION(src, dst)) has a heading — the columns
the function body may read from it, each with a type or ScalarType.ANY — and
reports ScalarType.ANY as its type, so that FunctionSymbol.parameterSignature() stays a
list of scalar types. A relation argument is a relation's name; the body sees it
narrowed to the heading.
Parameter names are used only for documentation and error messages; overload
resolution is based solely on the ordered list of type() values (the
parameter signature).
-
Constructor Summary
ConstructorsConstructorDescriptionParameterDefinition(String name, ScalarType type) A scalar parameter.ParameterDefinition(String name, ScalarType type, Optional<Schema> heading) Creates an instance of aParameterDefinitionrecord 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.heading()Returns the value of theheadingrecord component.booleanReturns whether this is a relation parameter.name()Returns the value of thenamerecord component.static ParameterDefinitionA relation parameter —name: RELATION(columns…).final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ParameterDefinition
Creates an instance of aParameterDefinitionrecord class. -
ParameterDefinition
A scalar parameter.- Parameters:
name- the parameter name; must not be blanktype- its scalar type; must not be null
-
-
Method Details
-
relation
A relation parameter —name: RELATION(columns…).- Parameters:
name- the parameter name; must not be blankheading- the columns the body may read; closed, and at least one- Returns:
- the parameter
-
isRelation
public boolean isRelation()Returns whether this is a relation parameter.- Returns:
- whether this is a relation parameter
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
heading
Returns the value of theheadingrecord component.- Returns:
- the value of the
headingrecord component
-