Package org.hl7.cql.model
Class ClassType
- java.lang.Object
-
- org.hl7.cql.model.DataType
-
- org.hl7.cql.model.ClassType
-
- All Implemented Interfaces:
NamedType
- Direct Known Subclasses:
ProfileType
public class ClassType extends DataType implements NamedType
-
-
Constructor Summary
Constructors Constructor Description ClassType()ClassType(java.lang.String name)ClassType(java.lang.String name, DataType baseType)ClassType(java.lang.String name, DataType baseType, java.util.Collection<ClassTypeElement> elements)ClassType(java.lang.String name, DataType baseType, java.util.Collection<ClassTypeElement> elements, java.util.Collection<TypeParameter> parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddElement(ClassTypeElement element)voidaddElements(java.util.Collection<ClassTypeElement> elements)voidaddGenericParameter(java.util.Collection<TypeParameter> parameters)Adds collection of type parameters to existing set.voidaddGenericParameter(TypeParameter genericParameter)Adds a parameter declaration to the generic type.voidaddRelationship(Relationship relationship)voidaddSearch(SearchType search)voidaddTargetRelationship(Relationship relationship)booleanequals(java.lang.Object o)SearchTypefindSearch(java.lang.String searchPath)java.util.List<ClassTypeElement>getAllElements()java.util.List<ClassTypeElement>getElements()TypeParametergetGenericParameterByIdentifier(java.lang.String identifier)Returns the parameter with the given parameter identifier.TypeParametergetGenericParameterByIdentifier(java.lang.String identifier, boolean inCurrentClassOnly)Returns the parameter with the given parameter identifier.java.util.List<TypeParameter>getGenericParameters()Returns the generic parameters for the generic type.java.lang.StringgetIdentifier()java.lang.StringgetLabel()java.lang.StringgetName()java.lang.StringgetNamespace()java.lang.StringgetPrimaryCodePath()java.lang.StringgetPrimaryValueSetPath()java.lang.Iterable<Relationship>getRelationships()java.lang.Iterable<SearchType>getSearches()java.lang.StringgetSimpleName()java.lang.StringgetTarget()java.lang.Iterable<Relationship>getTargetRelationships()TupleTypegetTupleType()inthashCode()DataTypeinstantiate(InstantiationContext context)booleanisCompatibleWith(DataType other)booleanisGeneric()booleanisInstantiable(DataType callType, InstantiationContext context)booleanisRetrievable()voidsetGenericParameters(java.util.List<TypeParameter> genericParameters)Sets the generic parameters for the generic type.voidsetIdentifier(java.lang.String identifier)voidsetLabel(java.lang.String label)voidsetPrimaryCodePath(java.lang.String primaryCodePath)voidsetPrimaryValueSetPath(java.lang.String primaryValueSetPath)voidsetRetrievable(boolean retrievable)voidsetTarget(java.lang.String target)java.lang.StringtoLabel()java.lang.StringtoString()-
Methods inherited from class org.hl7.cql.model.DataType
getBaseType, getCommonSuperTypeOf, isSubTypeOf, isSuperTypeOf
-
-
-
-
Constructor Detail
-
ClassType
public ClassType(java.lang.String name, DataType baseType, java.util.Collection<ClassTypeElement> elements, java.util.Collection<TypeParameter> parameters)
-
ClassType
public ClassType()
-
ClassType
public ClassType(java.lang.String name)
-
ClassType
public ClassType(java.lang.String name, DataType baseType)
-
ClassType
public ClassType(java.lang.String name, DataType baseType, java.util.Collection<ClassTypeElement> elements)
-
-
Method Detail
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespacein interfaceNamedType
-
getSimpleName
public java.lang.String getSimpleName()
- Specified by:
getSimpleNamein interfaceNamedType
-
getIdentifier
public java.lang.String getIdentifier()
-
setIdentifier
public void setIdentifier(java.lang.String identifier)
-
getLabel
public java.lang.String getLabel()
-
setLabel
public void setLabel(java.lang.String label)
-
setTarget
public void setTarget(java.lang.String target)
-
isRetrievable
public boolean isRetrievable()
-
setRetrievable
public void setRetrievable(boolean retrievable)
-
getPrimaryCodePath
public java.lang.String getPrimaryCodePath()
-
setPrimaryCodePath
public void setPrimaryCodePath(java.lang.String primaryCodePath)
-
getPrimaryValueSetPath
public java.lang.String getPrimaryValueSetPath()
-
setPrimaryValueSetPath
public void setPrimaryValueSetPath(java.lang.String primaryValueSetPath)
-
getRelationships
public java.lang.Iterable<Relationship> getRelationships()
-
addRelationship
public void addRelationship(Relationship relationship)
-
getTargetRelationships
public java.lang.Iterable<Relationship> getTargetRelationships()
-
addTargetRelationship
public void addTargetRelationship(Relationship relationship)
-
getSearches
public java.lang.Iterable<SearchType> getSearches()
-
addSearch
public void addSearch(SearchType search)
-
findSearch
public SearchType findSearch(java.lang.String searchPath)
-
getGenericParameters
public java.util.List<TypeParameter> getGenericParameters()
Returns the generic parameters for the generic type. For instance, for the generic type Map<K,V extends Person>, two generic parameters will be returned: K and V extends Person. The latter parameter has a constraint restricting the type of the bound type to be a valid subtype of Person.- Returns:
- Class' generic parameters
-
setGenericParameters
public void setGenericParameters(java.util.List<TypeParameter> genericParameters)
Sets the generic parameters for the generic type. For instance, for the generic type Map<K,V extends Person>, two generic parameters should be set: K and V extends Person. The latter parameter has a constraint restricting the type of the bound type to be a valid subtype of Person.- Parameters:
genericParameters-
-
addGenericParameter
public void addGenericParameter(TypeParameter genericParameter)
Adds a parameter declaration to the generic type.- Parameters:
genericParameter-
-
addGenericParameter
public void addGenericParameter(java.util.Collection<TypeParameter> parameters)
Adds collection of type parameters to existing set.- Parameters:
parameters-
-
getGenericParameterByIdentifier
public TypeParameter getGenericParameterByIdentifier(java.lang.String identifier)
Returns the parameter with the given parameter identifier. If not found in the given class, it looks in the parent class.- Parameters:
identifier-- Returns:
- Generic parameter with the given name in the current class or in the base class. Null if none found.
-
getGenericParameterByIdentifier
public TypeParameter getGenericParameterByIdentifier(java.lang.String identifier, boolean inCurrentClassOnly)
Returns the parameter with the given parameter identifier. If inCurrentClassOnly is false, if not found in the given class, then it looks in the parent class. If inCurrentClassOnly is true, only looks for parameter in the given class.- Parameters:
identifier-inCurrentClassOnly-- Returns:
- Class' generic parameter
-
getElements
public java.util.List<ClassTypeElement> getElements()
-
getAllElements
public java.util.List<ClassTypeElement> getAllElements()
-
addElement
public void addElement(ClassTypeElement element)
-
addElements
public void addElements(java.util.Collection<ClassTypeElement> elements)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getTupleType
public TupleType getTupleType()
-
isCompatibleWith
public boolean isCompatibleWith(DataType other)
- Overrides:
isCompatibleWithin classDataType
-
isInstantiable
public boolean isInstantiable(DataType callType, InstantiationContext context)
- Specified by:
isInstantiablein classDataType
-
instantiate
public DataType instantiate(InstantiationContext context)
- Specified by:
instantiatein classDataType
-
-