Module com.speedment.common.codegen
Interface AnnotationUsage
-
- All Superinterfaces:
HasCopy<AnnotationUsage>,HasType<AnnotationUsage>,HasValue<AnnotationUsage>
- All Known Implementing Classes:
DefaultAnnotationUsage
public interface AnnotationUsage extends HasCopy<AnnotationUsage>, HasType<AnnotationUsage>, HasValue<AnnotationUsage>
A model that represents the usage of a particular annotation in code.- Since:
- 2.0
- Author:
- Emil Forslund
- See Also:
Annotation
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<Map.Entry<String,Value<?>>>getValues()Returns a list of all the key-value pairs in this model.static AnnotationUsageof(Type type)Creates a new instance implementing this interface by using the default implementation.AnnotationUsageput(String key, Value<?> val)Use the specified key-value pair when referencing the annotation.default AnnotationUsageput(String key, Number numberValue)Use the specified key-value pair when referencing the annotation.default AnnotationUsageput(String key, String textValue)Use the specified key-value pair when referencing the annotation.
-
-
-
Method Detail
-
put
AnnotationUsage put(String key, Value<?> val)
Use the specified key-value pair when referencing the annotation. If you only want to show a single value without any key, consider using theHasValue.set(Value)method.- Parameters:
key- the keyval- the value- Returns:
- a reference to this model
-
put
default AnnotationUsage put(String key, String textValue)
Use the specified key-value pair when referencing the annotation. If you only want to show a single value without any key, consider using theHasValue.set(Value)method.This method works like
put(String, Value)except that the type of the value is automatically determined as aTextValue.- Parameters:
key- the keytextValue- the value- Returns:
- a reference to this model
- Since:
- 2.5
-
put
default AnnotationUsage put(String key, Number numberValue)
Use the specified key-value pair when referencing the annotation. If you only want to show a single value without any key, consider using theHasValue.set(Value)method.This method works like
put(String, Value)except that the type of the value is automatically determined as aNumberValue.- Parameters:
key- the keynumberValue- the value- Returns:
- a reference to this model
- Since:
- 2.5
-
getValues
List<Map.Entry<String,Value<?>>> getValues()
Returns a list of all the key-value pairs in this model.- Returns:
- all key-value pairs
-
of
static AnnotationUsage of(Type type)
Creates a new instance implementing this interface by using the default implementation.- Parameters:
type- the type- Returns:
- the new instance
-
-