Class Constables
java.lang.Object
org.microbean.construct.constant.Constables
A utility class that returns nominal descriptors for constructs.
- Author:
- Laird Nelson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic final <E> Optional<? extends ConstantDesc> describe(List<? extends E> list, Function<? super E, ? extends Optional<? extends ConstantDesc>> f) static <K,V> Optional <? extends ConstantDesc> describe(Map<? extends K, ? extends V> map, Function<? super K, ? extends Optional<? extends ConstantDesc>> kf, Function<? super V, ? extends Optional<? extends ConstantDesc>> vf) static final Optional<? extends ConstantDesc> describe(AnnotatedConstruct ac, Domain d) static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> describe(ExecutableElement e, Domain d) static final Optional<? extends ConstantDesc> describe(ModuleElement e, Domain d) static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> describe(PackageElement e, Domain d) static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> describe(TypeElement e, Domain d) static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> describe(VariableElement e, Domain d) static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> describe(DeclaredType t, Domain d) static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> static final Optional<? extends ConstantDesc> describe(PrimitiveType t, Domain d) static final Optional<? extends ConstantDesc> describe(TypeMirror t, Domain d) static final Optional<? extends ConstantDesc> describe(TypeVariable t, Domain d) static final Optional<? extends ConstantDesc> describe(WildcardType t, Domain d)
-
Method Details
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
n- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
ac- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
e- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
e- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
e- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
e- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
e- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
e- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
e- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
e- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
t- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
t- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
t- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
t- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
t- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
t- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
t- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
Returns a nominal descriptor for the supplied argument, presuming it to have originated from the suppliedDomain, or an emptyOptionalif the supplied argument cannot be described.- Parameters:
t- the argument; may benulld- theDomainfrom which the argument originated; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifdisnull
-
describe
public static final <E> Optional<? extends ConstantDesc> describe(List<? extends E> list, Function<? super E, ? extends Optional<? extends ConstantDesc>> f) Returns a nominal descriptor for the suppliedList, or an emptyOptionalif the suppliedListcannot be described.- Type Parameters:
E- the suppliedlist's element type- Parameters:
list- aListto be described; may benull; if non-nullmust be immutable and must not containnullelements or undefined behavior will resultf- aFunctionthat accepts an element from the suppliedlistand returns a non-nullOptionalhousing a nominal descriptor for it, or a non-nullemptyOptionalif the element cannot be described; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- iffisnulland needs to be used- See Also:
-
describe
public static <K,V> Optional<? extends ConstantDesc> describe(Map<? extends K, ? extends V> map, Function<? super K, ? extends Optional<? extends ConstantDesc>> kf, Function<? super V, ? extends Optional<? extends ConstantDesc>> vf) Returns a nominal descriptor for the suppliedMap, or an emptyOptionalif the suppliedMapcannot be described.- Type Parameters:
K- the suppliedmap's key typeV- the suppliedmap's value type- Parameters:
map- aMapto be described; may benull; if non-nullmust be immutable and must not containnullkeys or values or undefined behavior will resultkf- aFunctionthat accepts a key from the suppliedmapand returns a non-nullOptionalhousing a nominal descriptor for it, or a non-nullemptyOptionalif the key cannot be described; must not benullvf- aFunctionthat accepts a value from the suppliedmapand returns a non-nullOptionalhousing a nominal descriptor for it, or a non-nullemptyOptionalif the value cannot be described; must not benull- Returns:
- a non-
nullOptional - Throws:
NullPointerException- ifkforvfisnulland needs to be used- See Also:
-