Package org.rumbledb.types
Interface ItemType
- All Superinterfaces:
com.esotericsoftware.kryo.KryoSerializable
,Serializable
- All Known Implementing Classes:
ArrayItemType
,AtomicItemType
,DerivedAtomicItemType
,FunctionItemType
,ItemItemType
,ItemTypeReference
,JsonItemType
,ObjectItemType
,UnionItemType
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canBePromotedTo
(ItemType itemType) boolean
Tests for itemType equality.default ItemType
default ItemType
default boolean
default TimezoneFacet
default Integer
default String
default Integer
default Item
default Item
default Integer
default Item
default Item
default Integer
default Name
getName()
default Map<String,
FieldDescriptor> default ItemType
default FunctionSignature
default String
Returns the SparkSQL type of the item type for use in a query.default Integer
int
default UnionContentDescriptor
default boolean
hasName()
Tests for QName.default boolean
default boolean
default boolean
isCompatibleWithDataFrames
(RumbleRuntimeConfiguration configuration) Checks compatibility with DataFrames.default boolean
Tests for itemType equality.default boolean
default boolean
default boolean
default boolean
default boolean
default boolean
default boolean
isStaticallyCastableAs
(ItemType other) Check at static time if [this] could be casted to [other] item type, requires [this] to be an atomic typedefault boolean
isSubtypeOf
(ItemType superType) default boolean
default boolean
default boolean
default void
resolve
(DynamicContext context, ExceptionMetadata metadata) default void
resolve
(StaticContext context, ExceptionMetadata metadata) toString()
Methods inherited from interface com.esotericsoftware.kryo.KryoSerializable
read, write
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
-
Method Details
-
equals
Tests for itemType equality. -
isEqualTo
Tests for itemType equality.- Parameters:
otherType
- another item type.- Returns:
- true it is equal to other, false otherwise.
-
isTopmostItemType
default boolean isTopmostItemType()- Returns:
- true it [this] is the topmost item type.
-
isAtomicItemType
default boolean isAtomicItemType()- Returns:
- true it [this] is a subtype of an atomic item type.
-
isObjectItemType
default boolean isObjectItemType()- Returns:
- true it [this] is an object item type.
-
isArrayItemType
default boolean isArrayItemType()- Returns:
- true it [this] is an array item type.
-
isJsonItemType
default boolean isJsonItemType()- Returns:
- test if [this] is a subptype of a json item type
-
isUnionType
default boolean isUnionType() -
isFunctionItemType
default boolean isFunctionItemType()- Returns:
- true it [this] is a function item type.
-
isNumeric
default boolean isNumeric()- Returns:
- [true] if this is a numeric item type, false otherwise
-
hasName
default boolean hasName()Tests for QName.- Returns:
- true if [this] item type has a QName
-
getName
- Returns:
- the itemtype QName if available
-
getSignature
- Returns:
- the signature of the function item type if available
-
isSubtypeOf
- Parameters:
superType
- another item type- Returns:
- true if [this] is a subtype of [superType], any type is considered a subtype of itself. If [this] has a name, then this is determined strictly based on the hierarchy. If [this] does not have a name, then this is determined based on facets.
-
findLeastCommonSuperTypeWith
- Parameters:
other
- another item type- Returns:
- the common supertype between [this] and [other], that would be the LCA in the item type tree of [this] and [other] (does not take into account union types as common ancestor, but only the type tree)
-
getTypeTreeDepth
int getTypeTreeDepth()- Returns:
- an int representing the depth of the item type in the type tree ('item' is the root with depth 0)
-
getBaseType
ItemType getBaseType()- Returns:
- the base type for a type, return null for the topmost item type
-
isStaticallyCastableAs
Check at static time if [this] could be casted to [other] item type, requires [this] to be an atomic type- Parameters:
other
- a strict subtype of atomic item type to which we are trying to cast- Returns:
- true if it is possible at static time to cast [this] to [other], false otherwise
-
canBePromotedTo
- Parameters:
itemType
- another item type- Returns:
- true if [this] can be promoted to [itemType]
-
isUserDefined
default boolean isUserDefined()- Returns:
- [true] if it is a user-defined type, false otherwise
-
isPrimitive
default boolean isPrimitive()- Returns:
- [true] if it is a primitive type
-
getPrimitiveType
- Returns:
- the primitive type for a derived type, throw an error for primitive types
-
getAllowedFacets
Set<FacetTypes> getAllowedFacets()- Returns:
- a set containing the allowed facets for restricting the type
-
getEnumerationFacet
- Returns:
- the list of possible values for [this] item type or null if the enumeration facet is not set
-
getConstraintsFacet
- Returns:
- the list of constraints in the implementation-defined language for [this] item type (note that this facet is cumulative) or an empty list if the constraints facet is not set
-
getMinLengthFacet
- Returns:
- the minimum length facet value for [this] item type or null if the restriction is not set
-
getLengthFacet
- Returns:
- the length facet value for [this] item type or null if the restriction is not set
-
getMaxLengthFacet
- Returns:
- the maximum length facet value for [this] item type or null if the restriction is not set
-
getMinExclusiveFacet
- Returns:
- an item representing the minimum possible value (excluded) for [this] item type or null if the restriction is not set
-
getMinInclusiveFacet
- Returns:
- an item representing the minimum possible value (included) for [this] item type or null if the restriction is not set
-
getMaxExclusiveFacet
- Returns:
- an item representing the maximum possible value (excluded) for [this] item type or null if the restriction is not set
-
getMaxInclusiveFacet
- Returns:
- an item representing the maximum possible value (included) for [this] item type or null if the restriction is not set
-
getTotalDigitsFacet
- Returns:
- the total digits facet value for [this] item type or null if the restriction is not set
-
getFractionDigitsFacet
- Returns:
- the fraction digits facet value for [this] item type or null if the restriction is not set
-
getExplicitTimezoneFacet
- Returns:
- the explicit timezone facet value for [this] item type or null if the restriction is not set
-
getObjectContentFacet
- Returns:
- content facet value for object item types (cumulative facet)
-
getClosedFacet
default boolean getClosedFacet()- Returns:
- closed facet value for object item types
-
getArrayContentFacet
- Returns:
- content facet value for array item types
-
getUnionContentFacet
- Returns:
- content facet value for union item types
-
getIdentifierString
- Returns:
- a String that uniquely identify an item type
-
isCompatibleWithDataFrames
Checks compatibility with DataFrames.- Returns:
- true if compatible with DataFrames and false otherwise.
-
getSparkSQLType
Returns the SparkSQL type of the item type for use in a query.- Returns:
- String representing the SparkSQL type of the item type.
-
toString
String toString() -
isResolved
default boolean isResolved() -
resolve
-
resolve
-