Interface Type
-
- All Known Implementing Classes:
AnyType
,ArrayType
,BooleanType
,EmptyType
,EndpointType
,IntegerType
,OptionalType
,RecordType
,StringType
,TupleType
public interface Type
Types used to construct conditions out of values in the rules engine.
-
-
Method Summary
-
-
-
Method Detail
-
isA
default boolean isA(Type type)
Returns true if this type matches the target type.- Parameters:
type
- the target type to match.- Returns:
- true if the types match, false otherwise.
-
provenTruthy
default Type provenTruthy()
When used in the context of a condition, the condition can only match if the value was truthful. This means that a certain expression can be a different type, for example,OptionalType<T>
will becomeT
.- Returns:
- The type, given that it has been proven truthy
-
fromParameterType
static Type fromParameterType(ParameterType parameterType)
-
anyType
static AnyType anyType()
-
booleanType
static BooleanType booleanType()
-
emptyType
static EmptyType emptyType()
-
endpointType
static EndpointType endpointType()
-
integerType
static IntegerType integerType()
-
optionalType
static OptionalType optionalType(Type type)
-
recordType
static RecordType recordType(java.util.Map<Identifier,Type> inner)
-
stringType
static StringType stringType()
-
expectAnyType
default AnyType expectAnyType() throws InnerParseError
- Throws:
InnerParseError
-
expectArrayType
default ArrayType expectArrayType() throws InnerParseError
- Throws:
InnerParseError
-
expectBooleanType
default BooleanType expectBooleanType() throws InnerParseError
- Throws:
InnerParseError
-
expectEmptyType
default EmptyType expectEmptyType() throws InnerParseError
- Throws:
InnerParseError
-
expectEndpointType
default EndpointType expectEndpointType() throws InnerParseError
- Throws:
InnerParseError
-
expectIntegerType
default IntegerType expectIntegerType() throws InnerParseError
- Throws:
InnerParseError
-
expectOptionalType
default OptionalType expectOptionalType() throws InnerParseError
- Throws:
InnerParseError
-
expectRecordType
default RecordType expectRecordType(java.lang.String message) throws InnerParseError
- Throws:
InnerParseError
-
expectStringType
default StringType expectStringType() throws InnerParseError
- Throws:
InnerParseError
-
expectTupleType
default TupleType expectTupleType() throws InnerParseError
- Throws:
InnerParseError
-
-