Annotation Interface ObjectInstance


@Target(TYPE) @Retention(RUNTIME) public @interface ObjectInstance

Descriptor of object instance, can pass constructor arguments. Constructor arguments are constrained to string type.

For example, take class P:
 class P {
     P() { ... };
     P(String a) { ... };
     P(String a, String b) { ... };
     P(String a, int b) { ... }; // can't instantiate using instance descriptor!
 }
 
Instance descriptors to create 3 instances of object P, each using different constructor are:

 ObjectInstance (value = "no-arg", constructorArgs = {})
 ObjectInstance (value = "a", constructorArgs = {"someAValue"})
 ObjectInstance (value = "ab", constructorArgs = {"someAValue", "someBValue"})
 
Since:
0.1.0
Author:
Adam Dubiel
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    String array of constructor arguments, class has to have matching constructor.
    Name of instance.
  • Element Details

    • value

      String value
      Name of instance.
      Returns:
      name
    • constructorArgs

      String[] constructorArgs
      String array of constructor arguments, class has to have matching constructor.
      Returns:
      arguments