Package org.mule.metadata.api.model.impl
Class BaseMetadataType
- java.lang.Object
-
- org.mule.metadata.api.model.impl.BaseMetadataType
-
- All Implemented Interfaces:
FieldsComparable,MetadataType
- Direct Known Subclasses:
DefaultAnyType,DefaultArrayType,DefaultAttributeFieldType,DefaultAttributeKeyType,DefaultBinaryType,DefaultBooleanType,DefaultDateTimeType,DefaultDateType,DefaultFunctionType,DefaultIntersectionType,DefaultLocalDateTimeType,DefaultLocalTimeType,DefaultNothingType,DefaultNullType,DefaultNumberType,DefaultObjectFieldType,DefaultObjectKeyType,DefaultObjectType,DefaultPeriodType,DefaultRegexType,DefaultStringType,DefaultTimeType,DefaultTimeZoneType,DefaultTupleType,DefaultTypeParameterType,DefaultUnionType,DefaultVoidType
public abstract class BaseMetadataType extends Object implements MetadataType, FieldsComparable
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Class<? extends TypeAnnotation>,TypeAnnotation>annotations
-
Constructor Summary
Constructors Constructor Description BaseMetadataType(MetadataFormat metadataFormat, Map<Class<? extends TypeAnnotation>,TypeAnnotation> annotations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)<T extends TypeAnnotation>
Optional<T>getAnnotation(Class<T> extension)Returns anOptionalwith the annotation of a given type.Set<TypeAnnotation>getAnnotations()Returns all the annotations of the type.Optional<String>getDescription()Returns the description if specified.Object[]getFieldValues()A list of the fields that define the identity of this class.MetadataFormatgetMetadataFormat()Return the format of the underlying type system where this type was mapped from.inthashCode()StringtoString()-
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
accept
-
-
-
-
Field Detail
-
annotations
protected final Map<Class<? extends TypeAnnotation>,TypeAnnotation> annotations
-
-
Constructor Detail
-
BaseMetadataType
public BaseMetadataType(MetadataFormat metadataFormat, Map<Class<? extends TypeAnnotation>,TypeAnnotation> annotations)
-
-
Method Detail
-
getAnnotations
public Set<TypeAnnotation> getAnnotations()
Description copied from interface:MetadataTypeReturns all the annotations of the type.- Specified by:
getAnnotationsin interfaceMetadataType- Returns:
- The collection of annotations
-
getMetadataFormat
public MetadataFormat getMetadataFormat()
Description copied from interface:MetadataTypeReturn the format of the underlying type system where this type was mapped from. I.E XML- Specified by:
getMetadataFormatin interfaceMetadataType- Returns:
- The format.
-
getAnnotation
public <T extends TypeAnnotation> Optional<T> getAnnotation(Class<T> extension)
Description copied from interface:MetadataTypeReturns anOptionalwith the annotation of a given type.- Specified by:
getAnnotationin interfaceMetadataType- Parameters:
extension- The type of annotation- Returns:
Optionalwith the matched annotation.Optional.empty()if the annotation was not present.
-
getDescription
public Optional<String> getDescription()
Description copied from interface:MetadataTypeReturns the description if specified.- Specified by:
getDescriptionin interfaceMetadataType- Returns:
- The description if any.
-
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
-
-