Interface OptionInfo

All Superinterfaces:
Annotated, Prototype.Api
All Known Implementing Classes:
OptionInfo.BuilderBase.OptionInfoImpl

public interface OptionInfo extends Prototype.Api, Annotated
Model of a prototype/builder option.
See Also:
  • Method Details

    • builder

      static OptionInfo.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static OptionInfo.Builder builder(OptionInfo instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • interfaceMethod

      Optional<TypedElementInfo> interfaceMethod()
      Blueprint method if created from blueprint, or interface method if inherited from non-blueprint interface. Empty in case this is a "synthetic" option.
      Returns:
      interface method, if present
    • declaringType

      Optional<TypeInfo> declaringType()
      Type that declares this option. This may be the blueprint type, or an interface type. In case this is a "synthetic" option, there is not type to use.
      Returns:
      type that declares this option, if present
    • name

      String name()
      Option name.
      Returns:
      name of this option
    • getterName

      String getterName()
      Name of the getter methods.
      Returns:
      getter method name
    • setterName

      String setterName()
      Name of the setter method(s).
      Returns:
      setter method name
    • declaredType

      TypeName declaredType()
      The return type of the blueprint method, or the type expected in getter of the option.
      Returns:
      declared type
    • decorator

      Optional<TypeName> decorator()
      Option decorator type.
      Returns:
      type of the option decorator, if present
    • includeInToString

      boolean includeInToString()
      Whether to include this option in generated Object.toString() method.
      Returns:
      whether to include in the toString method
    • includeInEqualsAndHashCode

      boolean includeInEqualsAndHashCode()
      Whether to include this option in generated Object.equals(Object) and Object.hashCode() methods.
      Returns:
      whether to include in the equals and hashCode methods
    • confidential

      boolean confidential()
      Whether this option is confidential (i.e. we should not print the value in toString method).
      Returns:
      whether this option is confidential
    • registryService

      boolean registryService()
      Whether this option should be loaded from ServiceRegistry.
      Returns:
      whether this option should be loaded from ServiceRegistry
    • sameGeneric

      boolean sameGeneric()
      Whether this Map option is expected to have the same generic type for key and value. For example, for a Map<Class<?>, Instance<?>> that has sameGeneric set to true, we would generate singular method with signature <T> put(Class<T>, Instance<T>.
      Returns:
      whether a map has the same generic in key and value for a single mapping
    • required

      boolean required()
      Whether this is a required option. Will be true if:
      • an Option.Required is present in blueprint
      • the return type on blueprint is not Optional or a collection, and we do not support null
      Returns:
      whether the option is required
    • builderOptionOnly

      boolean builderOptionOnly()
      Set to true if this option is only available on the builder. In such a case the prototype and implementation will not have this option.
      Returns:
      builder option only
    • qualifiers

      List<Annotation> qualifiers()
      List of qualifiers for this option.
      Returns:
      service registry qualifiers defined on this option (to be used when getting a service registry instance)
    • allowedValues

      List<OptionAllowedValue> allowedValues()
      List of allowed values for this option.
      Returns:
      allowed values
    • defaultValue

      Optional<Consumer<ContentBuilder<?>>> defaultValue()
      Default value for this option, a consumer of the field content builder.
      Returns:
      default value consumer
    • configured

      Optional<OptionConfigured> configured()
      Details about configurability of this option.
      Returns:
      configured setup if configured
    • deprecation

      Optional<OptionDeprecation> deprecation()
      Deprecation details.
      Returns:
      deprecation details, if present
    • provider

      Provider details.
      Returns:
      provider details, if present
    • singular

      Singular option details.
      Returns:
      singular setter name and related information, if present
    • accessModifier

      AccessModifier accessModifier()
      Access modifier of generated setter methods on builder. Note that prototype methods are declared in an interface, so these must always be public.
      Returns:
      access modifier to use
    • builderInfo

      Optional<OptionBuilder> builderInfo()
      If the option has a builder, return its information.
      Returns:
      builder information, if present
    • runtimeType

      Optional<RuntimeTypeInfo> runtimeType()
      Custom runtime type factory method.
      Returns:
      runtime type factory method, if present
    • description

      Optional<String> description()
      Description of this option, used in Javadoc as the main text if defined.
      Returns:
      description, if present
    • paramDescription

      Optional<String> paramDescription()
      Parameter/return type description, used in Javadoc as the param/return description.
      Returns:
      parameter description, if present
    • prototypedBy

      default Optional<TypeName> prototypedBy()
      A prototype that can build this option type.
      Returns:
      prototyped by type, or empty if not annotated