public final class MetadataTypeUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MetadataTypeUtils.TypeResolverVisitor
MetadataTypeVisitor implementation for resolving the typeId of a given MetadataType. |
| Modifier and Type | Method and Description |
|---|---|
static void |
addTypeAlias(TypeBuilder typeBuilder,
String typeAlias)
Gives a type alias to type specified by builder.
|
static void |
checkArgument(boolean condition,
String message) |
static Optional<String> |
getDefaultValue(MetadataType type)
Returns the default value of a
MetadataType if exist. |
static String |
getLocalPart(ObjectFieldType field)
Returns the local part of an
ObjectFieldType |
static Optional<String> |
getTypeId(MetadataType type)
Returns the type id of a
MetadataType if exist. |
static boolean |
hasExposedFields(MetadataType type)
Returns if an
ObjectType has at least one exposed field or not, for any other MetadataType returns false. |
static int |
hashCode(Optional<?>... optionals) |
static boolean |
isCollection(MetadataType type)
Returns whether a metadata type is an instance of an
ArrayType or not. |
static boolean |
isEnum(MetadataType type)
Indicates whether the give
MetadataType is an Enum or not. |
static boolean |
isNotNull(Object object)
Checks if the given object is null or not
|
static boolean |
isNullType(MetadataType type)
Returns whether a metadata type is an instance of
NullType or not. |
static boolean |
isObjectType(MetadataType type)
Returns whether a metadata type is an instance of
ObjectType or not. |
static boolean |
isVoid(MetadataType type)
Returns whether a metadata type is an instance of
VoidType or not. |
public static void checkArgument(boolean condition,
String message)
condition - Condition that the argument must satisfymessage - The Message of the exception in case the condition is invalidpublic static Optional<String> getTypeId(MetadataType type)
MetadataType if exist.type - the metadata type to search de type id from.public static void addTypeAlias(TypeBuilder typeBuilder, String typeAlias)
typeBuilder - The type builder to annotate.typeAlias - The type alias to use.public static Optional<String> getDefaultValue(MetadataType type)
MetadataType if exist.type - the metadata type to search de default value from.public static boolean isVoid(MetadataType type)
VoidType or not.type - the metadata type to check.public static boolean isNullType(MetadataType type)
NullType or not.type - the metadata type to check.public static boolean isCollection(MetadataType type)
ArrayType or not.type - the metadata type to check.public static boolean isObjectType(MetadataType type)
ObjectType or not.type - the metadata type to check.public static boolean hasExposedFields(MetadataType type)
ObjectType has at least one exposed field or not, for any other MetadataType returns false.type - the metadata type to check.public static String getLocalPart(ObjectFieldType field)
ObjectFieldTypefield - the field to obtain the local partpublic static boolean isEnum(MetadataType type)
MetadataType is an Enum or not.type - MetadataType to check if it is an Enumpublic static int hashCode(Optional<?>... optionals)
public static boolean isNotNull(Object object)
Copyright © 2023 MuleSoft, Inc.. All rights reserved.