Interface TypeLiaison.DefaultInit<V>

Type Parameters:
V - the type of the configuration object
Enclosing interface:
TypeLiaison

public static interface TypeLiaison.DefaultInit<V>
Provides relevant resources related to default value creation
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull TypeToken<?>
    The interface type where the method is located, after computing inheritance.
    @NonNull String
    The label for the entry, typically the method name
    Gets method level annotations for the entry being initialized
    @Nullable DefaultValues<V>
    Extracts default values from the default method if one exists.
  • Method Details

    • enclosingType

      @NonNull TypeToken<?> enclosingType()
      The interface type where the method is located, after computing inheritance.

      In particular, this is the configuration interface passed to the library. This is not the source code location, which means that if the configuration type extends one or more parent interfaces, the main interface will always be returned (and never a parent interface).

      Returns:
      the interface type
    • label

      @NonNull String label()
      The label for the entry, typically the method name
      Returns:
      the label
    • methodAnnotations

      @NonNull AnnotatedElement methodAnnotations()
      Gets method level annotations for the entry being initialized
      Returns:
      the method level annotations
    • methodDefault

      @Nullable DefaultValues<V> methodDefault()
      Extracts default values from the default method if one exists.

      Returns null if there is no default method implementation. If the default method returns Optional and the optional was empty, this method also returns null.

      Returns:
      the default values from the default method
      Throws:
      DeveloperMistakeException - if the default method is implemented incorrectly. Liaison implementations should not catch this exception but simply let it propagate