Package org.mule.metadata.api.model.impl
Class DefaultObjectKeyType
- java.lang.Object
-
- org.mule.metadata.api.model.impl.BaseMetadataType
-
- org.mule.metadata.api.model.impl.DefaultObjectKeyType
-
- All Implemented Interfaces:
FieldsComparable,MetadataType,ObjectKeyType
public class DefaultObjectKeyType extends BaseMetadataType implements ObjectKeyType
-
-
Field Summary
-
Fields inherited from class org.mule.metadata.api.model.impl.BaseMetadataType
annotations
-
-
Constructor Summary
Constructors Constructor Description DefaultObjectKeyType(Optional<QName> name, Optional<Pattern> pattern, Collection<AttributeFieldType> attributes, MetadataFormat metadataFormat, Map<Class<? extends TypeAnnotation>,TypeAnnotation> extensions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(MetadataTypeVisitor visitor)Dispatches in a reflective way to the method with prefix "visit" with the specific type as argument.booleanequals(Object o)Collection<AttributeFieldType>getAttributes()All the attributes of this keyObject[]getFieldValues()A list of the fields that define the identity of this class.Optional<String>getLabel()QNamegetName()The name of the key if it is a named key else throws a NoSuchElementException.PatterngetPattern()The pattern of the key if it is a pattern based key else throws a NoSuchElementException.inthashCode()booleanisName()Return if the this is a named key or notbooleanisPattern()Return if the this is a pattern key or not.StringtoString()-
Methods inherited from class org.mule.metadata.api.model.impl.BaseMetadataType
getAnnotation, getAnnotations, getDescription, getMetadataFormat
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.mule.metadata.api.model.MetadataType
getAnnotation, getAnnotations, getDescription, getMetadataFormat
-
-
-
-
Constructor Detail
-
DefaultObjectKeyType
public DefaultObjectKeyType(Optional<QName> name, Optional<Pattern> pattern, Collection<AttributeFieldType> attributes, MetadataFormat metadataFormat, Map<Class<? extends TypeAnnotation>,TypeAnnotation> extensions)
-
-
Method Detail
-
getName
public QName getName()
Description copied from interface:ObjectKeyTypeThe name of the key if it is a named key else throws a NoSuchElementException.- Specified by:
getNamein interfaceObjectKeyType- Returns:
- The name of the key.
-
isName
public boolean isName()
Description copied from interface:ObjectKeyTypeReturn if the this is a named key or not- Specified by:
isNamein interfaceObjectKeyType- Returns:
Trueif it is a named key
-
getPattern
public Pattern getPattern()
Description copied from interface:ObjectKeyTypeThe pattern of the key if it is a pattern based key else throws a NoSuchElementException.- Specified by:
getPatternin interfaceObjectKeyType- Returns:
- The name of the key.
-
isPattern
public boolean isPattern()
Description copied from interface:ObjectKeyTypeReturn if the this is a pattern key or not.- Specified by:
isPatternin interfaceObjectKeyType- Returns:
Trueif it is a pattern key
-
getAttributes
public Collection<AttributeFieldType> getAttributes()
Description copied from interface:ObjectKeyTypeAll the attributes of this key- Specified by:
getAttributesin interfaceObjectKeyType- Returns:
- The collection with the attributes
-
accept
public void accept(MetadataTypeVisitor visitor)
Description copied from interface:MetadataTypeDispatches in a reflective way to the method with prefix "visit" with the specific type as argument. ExamplevisitObject(ObjectType objectType)will be called when this type is an ObjectType.- Specified by:
acceptin interfaceMetadataType- Parameters:
visitor- The visitor
-
toString
public String toString()
- Overrides:
toStringin classBaseMetadataType
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classBaseMetadataType
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBaseMetadataType
-
getFieldValues
public Object[] getFieldValues()
Description copied from interface:FieldsComparableA list of the fields that define the identity of this class. These fields can be used to compare if instances of a class are equal, or to generate a hash code for it.Have in mind not exposing fields of class
Pattern, for example, that only check for reference equality (If that is not the desired behaviour).- Specified by:
getFieldValuesin interfaceFieldsComparable- Overrides:
getFieldValuesin classBaseMetadataType
-
-