Class Getter


  • public class Getter
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Getter()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static io.sundr.model.Method find​(io.sundr.model.TypeDef clazz, io.sundr.model.Property property)
      Find the getter of the specified property in the type.
      static io.sundr.model.Method find​(io.sundr.model.TypeDef clazz, io.sundr.model.Property property, boolean acceptPrefixless)
      Find the getter of the specified property in the type.
      static Optional<io.sundr.model.Method> findOptional​(io.sundr.model.TypeDef clazz, io.sundr.model.Property property)  
      static io.sundr.model.Method forProperty​(io.sundr.model.Property property)  
      static boolean is​(io.sundr.model.Method method)
      Checks if the specified method is a getter.
      static boolean is​(io.sundr.model.Method method, boolean acceptPrefixless)
      Checks if the specified method is a getter.
      static String name​(io.sundr.model.Property property)
      Return the getter name for the specified Property.
      static String prefix​(io.sundr.model.Property property)  
      static String propertyName​(io.sundr.model.Method method)
      Return the property name for the specified getter method.
      static String propertyNameSafe​(io.sundr.model.Method method)
      Return the property name for the specified getter method.
    • Constructor Detail

      • Getter

        public Getter()
    • Method Detail

      • find

        public static io.sundr.model.Method find​(io.sundr.model.TypeDef clazz,
                                                 io.sundr.model.Property property)
        Find the getter of the specified property in the type.
        Parameters:
        clazz - The class.
        property - The property.
        Returns:
        The getter method if found. Throws exception if no getter is matched.
      • findOptional

        public static Optional<io.sundr.model.Method> findOptional​(io.sundr.model.TypeDef clazz,
                                                                   io.sundr.model.Property property)
      • find

        public static io.sundr.model.Method find​(io.sundr.model.TypeDef clazz,
                                                 io.sundr.model.Property property,
                                                 boolean acceptPrefixless)
        Find the getter of the specified property in the type.
        Parameters:
        clazz - The class.
        property - The property.
        acceptPrefixless - Flag to accept prefixless getters.
        Returns:
        The getter method if found. Throws exception if no getter is matched.
      • is

        public static boolean is​(io.sundr.model.Method method)
        Checks if the specified method is a getter.
        Parameters:
        method - The specified method.
        Returns:
        True if getter, false otherwise.
      • is

        public static boolean is​(io.sundr.model.Method method,
                                 boolean acceptPrefixless)
        Checks if the specified method is a getter.
        Parameters:
        method - The method.
        acceptPrefixless - Flag to enable support of prefixless getters.
        Returns:
      • forProperty

        public static final io.sundr.model.Method forProperty​(io.sundr.model.Property property)
      • name

        public static String name​(io.sundr.model.Property property)
        Return the getter name for the specified Property.
        Parameters:
        property - The property.
        Returns:
        The name.
      • propertyName

        public static String propertyName​(io.sundr.model.Method method)
        Return the property name for the specified getter method.
        Parameters:
        method - The method.
        Returns:
        The name.
      • propertyNameSafe

        public static String propertyNameSafe​(io.sundr.model.Method method)
        Return the property name for the specified getter method. This method will not check if the method is an actual getter and will return the method name if not.
        Parameters:
        method - The method.
        Returns:
        The name, or the method name if method is not a typical getter..
      • prefix

        public static String prefix​(io.sundr.model.Property property)