Package org.mule.metadata.api.model.impl
Class DefaultObjectType
- java.lang.Object
-
- org.mule.metadata.api.model.impl.BaseMetadataType
-
- org.mule.metadata.api.model.impl.DefaultObjectType
-
- All Implemented Interfaces:
FieldsComparable,MetadataType,ObjectType
public class DefaultObjectType extends BaseMetadataType implements ObjectType
-
-
Field Summary
-
Fields inherited from class org.mule.metadata.api.model.impl.BaseMetadataType
annotations
-
-
Constructor Summary
Constructors Constructor Description DefaultObjectType(Collection<ObjectFieldType> fields, boolean ordered, MetadataType openRestriction, 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.Optional<ObjectFieldType>getFieldByName(String propertyName)Searches a field that matches the specified nameCollection<ObjectFieldType>getFields()The collection of all the fieldsObject[]getFieldValues()A list of the fields that define the identity of this class.Optional<MetadataType>getOpenRestriction()Returns the restriction if any specified for the open type.booleanisOrdered()If the list of fields must respect the order or notStringtoString()-
Methods inherited from class org.mule.metadata.api.model.impl.BaseMetadataType
equals, getAnnotation, getAnnotations, getDescription, getMetadataFormat, hashCode
-
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
-
Methods inherited from interface org.mule.metadata.api.model.ObjectType
isOpen
-
-
-
-
Constructor Detail
-
DefaultObjectType
public DefaultObjectType(Collection<ObjectFieldType> fields, boolean ordered, MetadataType openRestriction, MetadataFormat metadataFormat, Map<Class<? extends TypeAnnotation>,TypeAnnotation> extensions)
-
-
Method Detail
-
isOrdered
public boolean isOrdered()
Description copied from interface:ObjectTypeIf the list of fields must respect the order or not- Specified by:
isOrderedin interfaceObjectType- Returns:
- True if they must be ordered
-
getOpenRestriction
public Optional<MetadataType> getOpenRestriction()
Description copied from interface:ObjectTypeReturns the restriction if any specified for the open type. This restriction applies to the type of the object's fields.- Specified by:
getOpenRestrictionin interfaceObjectType- Returns:
- The restriction if any
-
getFields
public Collection<ObjectFieldType> getFields()
Description copied from interface:ObjectTypeThe collection of all the fields- Specified by:
getFieldsin interfaceObjectType- Returns:
- The object fields
-
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
-
getFieldByName
public Optional<ObjectFieldType> getFieldByName(String propertyName)
Description copied from interface:ObjectTypeSearches a field that matches the specified name- Specified by:
getFieldByNamein interfaceObjectType- Parameters:
propertyName- The name of the property- Returns:
- The field is any
-
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
-
-