Interface Type
- All Known Implementing Classes:
Type.Any
,Type.Array
,Type.Bool
,Type.Empty
,Type.Endpoint
,Type.Integer
,Type.Option
,Type.Record
,Type.String
,Type.Tuple
public interface Type
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
static final class
static final class
static final class
static final class
static final class
static final class
static final class
static final class
static final class
-
Method Summary
Modifier and TypeMethodDescriptionstatic Type.Array
static Type.Bool
bool()
static Type
empty()
static Type.Endpoint
endpoint()
default Type.Array
default Type.Bool
default Type.Integer
default Type.Record
expectObject
(String message) default Type.Option
default Type.String
static Type
integer()
default boolean
static Type.Option
default Type
When used in the context of a condition, the condition can only match if the value was truthful.static Type.Record
record
(Map<Identifier, Type> inner) static Type.String
string()
-
Method Details
-
string
-
endpoint
-
empty
-
array
-
record
-
integer
-
optional
-
bool
-
expectString
- Throws:
InnerParseError
-
expectObject
- Throws:
InnerParseError
-
expectBool
- Throws:
InnerParseError
-
expectInt
- Throws:
InnerParseError
-
expectOptional
- Throws:
InnerParseError
-
expectArray
- Throws:
InnerParseError
-
isA
-
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,Option<T>
will becomeT
.- Returns:
- The type, given that it has been proven truthy
-