Class Getter

java.lang.Object
io.sundr.model.utils.Getter

public class Getter extends Object
  • Field Details

  • Constructor Details

    • Getter

      public Getter()
  • Method Details

    • find

      public static Method find(TypeDef clazz, 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<Method> findOptional(TypeDef clazz, Property property)
    • find

      public static Method find(TypeDef clazz, 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(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(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 Method forProperty(Property property)
    • name

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

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

      public static String propertyNameSafe(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(Property property)