public class BuilderUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Collection<String> |
allGenericsOf(io.sundr.model.Method method) |
static Collection<String> |
allGenericsOf(io.sundr.model.Property property) |
static Set<String> |
allGenericsOf(io.sundr.model.TypeDef clazz) |
static Set<String> |
allGenericsOf(io.sundr.model.TypeRef type) |
static List<io.sundr.model.ClassRef> |
alsoImport(io.sundr.model.Attributeable attributeable,
io.sundr.model.ClassRef... refs) |
static List<io.sundr.model.ClassRef> |
alsoImportAsList(io.sundr.model.Attributeable attributeable) |
static List<io.sundr.model.TypeRef> |
appendNewGenericArgument(io.sundr.model.ClassRef type,
io.sundr.model.TypeParamRef... excluded) |
static List<io.sundr.model.TypeRef> |
appendNewWildcardArgument(io.sundr.model.ClassRef type) |
static io.sundr.model.Property |
arrayAsList(io.sundr.model.Property property) |
static io.sundr.model.Property |
buildableField(io.sundr.model.Property property) |
static boolean |
canBeBuilt(io.sundr.model.TypeDef typeDef) |
static boolean |
canBeBuilt(io.sundr.model.TypeRef typeRef) |
static Map<String,io.sundr.model.ClassRef> |
enclosedBuildables(io.sundr.model.TypeDef typeDef)
Get all the enclosingTypes.
|
static io.sundr.model.Method |
findBuildableConstructor(io.sundr.model.TypeDef clazz) |
static List<io.sundr.model.ClassRef> |
findBuildableReferences(io.sundr.model.ClassRef ref)
Returns all references of a
ClassRef that are considered buildable. |
static io.sundr.model.TypeDef |
findBuildableSuperClass(io.sundr.model.TypeDef clazz) |
static io.sundr.model.ClassRef |
findBuildableSuperClassRef(io.sundr.model.TypeDef clazz) |
static String |
fullyQualifiedNameDiff(io.sundr.model.TypeRef typeRef,
io.sundr.model.TypeDef originType) |
static Set<TypeElement> |
getBuildableReferences(BuilderContext context,
Buildable buildable) |
static Set<TypeElement> |
getBuildableReferences(BuilderContext context,
ExternalBuildables buildable) |
static Set<io.sundr.model.Method> |
getInlineableConstructors(io.sundr.model.Property property) |
static io.sundr.model.TypeDef |
getInlineReturnType(BuilderContext context,
Inline inline,
io.sundr.model.TypeDef fallback) |
static io.sundr.model.TypeDef |
getInlineType(BuilderContext context,
Inline inline) |
static io.sundr.model.TypeParamRef |
getNextGeneric(io.sundr.model.ClassRef classRef,
Collection<io.sundr.model.TypeParamRef> excluded) |
static io.sundr.model.TypeParamRef |
getNextGeneric(io.sundr.model.ClassRef type,
io.sundr.model.TypeParamRef... excluded) |
static io.sundr.model.TypeParamDef |
getNextGeneric(io.sundr.model.TypeDef type,
Collection excluded) |
static io.sundr.model.TypeParamDef |
getNextGeneric(io.sundr.model.TypeDef type,
io.sundr.model.TypeParamDef... excluded) |
static boolean |
hasBuildableConstructorWithArgument(io.sundr.model.TypeDef clazz,
io.sundr.model.Property property) |
static boolean |
hasDefaultConstructor(io.sundr.model.TypeDef item)
Checks if there is a default constructor available.
|
static boolean |
hasDefaultConstructor(io.sundr.model.TypeRef item)
Checks if there is a default constructor available.
|
static String |
ifNotNullToString(io.sundr.model.Property property,
boolean hasNext) |
static boolean |
isBuildable(io.sundr.model.ClassRef ref)
Checks if
ClassRef is buildable. |
static boolean |
isBuildable(io.sundr.model.TypeDef typeDef) |
static boolean |
isBuildable(io.sundr.model.TypeRef typeRef) |
static boolean |
isInlineable(io.sundr.model.Method method) |
static boolean |
isOrHasBuildableDescendants(io.sundr.model.Property property) |
static boolean |
isRegisteredAsBuildable(io.sundr.model.TypeDef typeDef) |
static boolean |
isRegisteredAsBuildable(io.sundr.model.TypeRef typeRef) |
static boolean |
methodHasArgument(io.sundr.model.Method method,
io.sundr.model.Property property)
Checks if method has a specific argument.
|
static void |
populateEnclosedBuildables(io.sundr.model.TypeDef typeDef,
Map<String,io.sundr.model.ClassRef> result) |
static List<io.sundr.model.Statement> |
toEquals(io.sundr.model.Nameable nameable,
Collection<io.sundr.model.Property> properties) |
static List<io.sundr.model.Statement> |
toHashCode(Collection<io.sundr.model.Property> properties) |
static List<io.sundr.model.Statement> |
toString(String name,
Collection<io.sundr.model.Property> properties) |
public static boolean canBeBuilt(io.sundr.model.TypeRef typeRef)
public static boolean canBeBuilt(io.sundr.model.TypeDef typeDef)
public static boolean isRegisteredAsBuildable(io.sundr.model.TypeRef typeRef)
public static boolean isBuildable(io.sundr.model.TypeRef typeRef)
public static boolean isRegisteredAsBuildable(io.sundr.model.TypeDef typeDef)
public static boolean isBuildable(io.sundr.model.TypeDef typeDef)
public static boolean isBuildable(io.sundr.model.ClassRef ref)
ClassRef is buildable.ref - The reference.public static boolean isOrHasBuildableDescendants(io.sundr.model.Property property)
public static List<io.sundr.model.ClassRef> findBuildableReferences(io.sundr.model.ClassRef ref)
ClassRef that are considered buildable.ref - The reference.public static io.sundr.model.ClassRef findBuildableSuperClassRef(io.sundr.model.TypeDef clazz)
public static io.sundr.model.TypeDef findBuildableSuperClass(io.sundr.model.TypeDef clazz)
public static io.sundr.model.Method findBuildableConstructor(io.sundr.model.TypeDef clazz)
public static boolean methodHasArgument(io.sundr.model.Method method,
io.sundr.model.Property property)
method - The method.property - The argument.public static boolean hasBuildableConstructorWithArgument(io.sundr.model.TypeDef clazz,
io.sundr.model.Property property)
public static boolean hasDefaultConstructor(io.sundr.model.TypeRef item)
item - The clazz to check.public static boolean hasDefaultConstructor(io.sundr.model.TypeDef item)
item - The clazz to check.public static Set<io.sundr.model.Method> getInlineableConstructors(io.sundr.model.Property property)
public static boolean isInlineable(io.sundr.model.Method method)
public static io.sundr.model.TypeDef getInlineType(BuilderContext context, Inline inline)
public static io.sundr.model.TypeDef getInlineReturnType(BuilderContext context, Inline inline, io.sundr.model.TypeDef fallback)
public static Set<TypeElement> getBuildableReferences(BuilderContext context, Buildable buildable)
public static Set<TypeElement> getBuildableReferences(BuilderContext context, ExternalBuildables buildable)
public static io.sundr.model.TypeParamDef getNextGeneric(io.sundr.model.TypeDef type,
io.sundr.model.TypeParamDef... excluded)
public static io.sundr.model.TypeParamRef getNextGeneric(io.sundr.model.ClassRef type,
io.sundr.model.TypeParamRef... excluded)
public static List<io.sundr.model.TypeRef> appendNewGenericArgument(io.sundr.model.ClassRef type, io.sundr.model.TypeParamRef... excluded)
public static List<io.sundr.model.TypeRef> appendNewWildcardArgument(io.sundr.model.ClassRef type)
public static io.sundr.model.TypeParamDef getNextGeneric(io.sundr.model.TypeDef type,
Collection excluded)
public static io.sundr.model.TypeParamRef getNextGeneric(io.sundr.model.ClassRef classRef,
Collection<io.sundr.model.TypeParamRef> excluded)
public static Collection<String> allGenericsOf(io.sundr.model.Property property)
public static Collection<String> allGenericsOf(io.sundr.model.Method method)
public static String fullyQualifiedNameDiff(io.sundr.model.TypeRef typeRef, io.sundr.model.TypeDef originType)
public static io.sundr.model.Property arrayAsList(io.sundr.model.Property property)
public static io.sundr.model.Property buildableField(io.sundr.model.Property property)
public static void populateEnclosedBuildables(io.sundr.model.TypeDef typeDef,
Map<String,io.sundr.model.ClassRef> result)
public static Map<String,io.sundr.model.ClassRef> enclosedBuildables(io.sundr.model.TypeDef typeDef)
typeDef - the typeDef that we check for enclosed buildables.public static List<io.sundr.model.ClassRef> alsoImportAsList(io.sundr.model.Attributeable attributeable)
public static List<io.sundr.model.ClassRef> alsoImport(io.sundr.model.Attributeable attributeable, io.sundr.model.ClassRef... refs)
public static List<io.sundr.model.Statement> toString(String name, Collection<io.sundr.model.Property> properties)
public static String ifNotNullToString(io.sundr.model.Property property, boolean hasNext)
public static List<io.sundr.model.Statement> toHashCode(Collection<io.sundr.model.Property> properties)
public static List<io.sundr.model.Statement> toEquals(io.sundr.model.Nameable nameable, Collection<io.sundr.model.Property> properties)
Copyright © 2023. All rights reserved.