Package io.fabric8.crd.generator.utils
Class Types
- java.lang.Object
-
- io.fabric8.crd.generator.utils.Types
-
public class Types extends Object
-
-
Constructor Summary
Constructors Constructor Description Types()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<io.sundr.codegen.model.Property>allProperties(io.sundr.codegen.model.TypeDef typeDef)All properties (including inherited).static io.sundr.codegen.model.TypeDefapplyTypeArguments(io.sundr.codegen.model.ClassRef ref)Apply type arguments on all generic properties of aClassRef.static Optional<io.sundr.codegen.model.Property>findStatusProperty(io.sundr.codegen.model.TypeDef typeDef)Finds the status property.static booleanisNamespaced(io.sundr.codegen.model.TypeDef definition)static booleanisNamespaced(io.sundr.codegen.model.TypeDef definition, Set<io.sundr.codegen.model.TypeDef> visited)static booleanisStatusProperty(io.sundr.codegen.model.Property property)Returns true if the specified property corresponds to status.static Set<io.sundr.codegen.model.TypeDef>unrollHierarchy(io.sundr.codegen.model.TypeDef typeDef)Unrolls the hierarchy of a specified type.
-
-
-
Method Detail
-
allProperties
public static List<io.sundr.codegen.model.Property> allProperties(io.sundr.codegen.model.TypeDef typeDef)
All properties (including inherited).- Parameters:
typeDef- The type.- Returns:
- A list with all properties.
-
unrollHierarchy
public static Set<io.sundr.codegen.model.TypeDef> unrollHierarchy(io.sundr.codegen.model.TypeDef typeDef)
Unrolls the hierarchy of a specified type.- Parameters:
typeDef- The specified type.- Returns:
- A set that contains the complete type hierarchy (including the specified type).
-
applyTypeArguments
public static io.sundr.codegen.model.TypeDef applyTypeArguments(io.sundr.codegen.model.ClassRef ref)
Apply type arguments on all generic properties of aClassRef.- Parameters:
ref- theClassRefon which we want to apply the type arguments- Returns:
- the result of the application
-
isNamespaced
public static boolean isNamespaced(io.sundr.codegen.model.TypeDef definition)
-
isNamespaced
public static boolean isNamespaced(io.sundr.codegen.model.TypeDef definition, Set<io.sundr.codegen.model.TypeDef> visited)
-
findStatusProperty
public static Optional<io.sundr.codegen.model.Property> findStatusProperty(io.sundr.codegen.model.TypeDef typeDef)
Finds the status property. The method look up for a status property.- Parameters:
typeDef- the type whose status property we want to find- Returns:
- the an optional property.
-
isStatusProperty
public static boolean isStatusProperty(io.sundr.codegen.model.Property property)
Returns true if the specified property corresponds to status. A property qualifies as `status` if it is called `status`.- Parameters:
property- the property we want to check- Returns:
trueif namedstatus,falseotherwise
-
-