Class 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.TypeDef applyTypeArguments​(io.sundr.codegen.model.ClassRef ref)
      Apply type arguments on all generic properties of a ClassRef.
      static Optional<io.sundr.codegen.model.Property> findStatusProperty​(io.sundr.codegen.model.TypeDef typeDef)
      Finds the status property.
      static boolean isNamespaced​(io.sundr.codegen.model.TypeDef definition)  
      static boolean isNamespaced​(io.sundr.codegen.model.TypeDef definition, Set<io.sundr.codegen.model.TypeDef> visited)  
      static boolean isStatusProperty​(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.
    • Constructor Detail

      • Types

        public Types()
    • 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 a ClassRef.
        Parameters:
        ref - the ClassRef on 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:
        true if named status, false otherwise