Package org.mule.metadata.api.model.impl
Class DefaultObjectFieldType
- java.lang.Object
-
- org.mule.metadata.api.model.impl.BaseMetadataType
-
- org.mule.metadata.api.model.impl.DefaultObjectFieldType
-
- All Implemented Interfaces:
FieldsComparable,MetadataType,ObjectFieldType
public class DefaultObjectFieldType extends BaseMetadataType implements ObjectFieldType
-
-
Field Summary
-
Fields inherited from class org.mule.metadata.api.model.impl.BaseMetadataType
annotations
-
-
Constructor Summary
Constructors Constructor Description DefaultObjectFieldType(ObjectKeyType key, MetadataType value, boolean isRequired, boolean isRepeated, MetadataFormat metadataFormat, Map<Class<? extends TypeAnnotation>,TypeAnnotation> annotations)
-
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.Object[]getFieldValues()A list of the fields that define the identity of this class.ObjectKeyTypegetKey()The key of this fieldMetadataTypegetValue()The value of this fieldbooleanisRepeated()If this field can be present more than once in an objectbooleanisRequired()If the field is required or not-
Methods inherited from class org.mule.metadata.api.model.impl.BaseMetadataType
equals, getAnnotation, getAnnotations, getDescription, getMetadataFormat, hashCode, toString
-
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
-
DefaultObjectFieldType
public DefaultObjectFieldType(ObjectKeyType key, MetadataType value, boolean isRequired, boolean isRepeated, MetadataFormat metadataFormat, Map<Class<? extends TypeAnnotation>,TypeAnnotation> annotations)
-
-
Method Detail
-
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
-
getKey
public ObjectKeyType getKey()
Description copied from interface:ObjectFieldTypeThe key of this field- Specified by:
getKeyin interfaceObjectFieldType- Returns:
- The key
-
getValue
public MetadataType getValue()
Description copied from interface:ObjectFieldTypeThe value of this field- Specified by:
getValuein interfaceObjectFieldType- Returns:
- The value
-
isRequired
public boolean isRequired()
Description copied from interface:ObjectFieldTypeIf the field is required or not- Specified by:
isRequiredin interfaceObjectFieldType- Returns:
- True if is required
-
isRepeated
public boolean isRepeated()
Description copied from interface:ObjectFieldTypeIf this field can be present more than once in an object- Specified by:
isRepeatedin interfaceObjectFieldType- Returns:
- True if it can be repeated
-
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
-
-