java.lang.Object
io.helidon.common.types.DefaultAnnotationAndValue
- All Implemented Interfaces:
AnnotationAndValue,Comparable<AnnotationAndValue>
- Direct Known Subclasses:
DefaultQualifierAndValue
public class DefaultAnnotationAndValue
extends Object
implements AnnotationAndValue, Comparable<AnnotationAndValue>
The default implementation for
AnnotationAndValue.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCtor. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forAnnotationAndValue.intcompareTo(AnnotationAndValue other) static DefaultAnnotationAndValueCreates an instance for an annotation with no value.static DefaultAnnotationAndValueCreates an instance for an annotation with a value.static DefaultAnnotationAndValueCreates an instance for annotation with zero or more values.static DefaultAnnotationAndValuecreate(Class<? extends Annotation> annoType) Creates an instance for an annotation with no value.static DefaultAnnotationAndValuecreate(Class<? extends Annotation> annoType, String value) Creates an instance for an annotation with a value.static DefaultAnnotationAndValueCreates an instance for an annotation with a value.booleanstatic Optional<? extends AnnotationAndValue>findFirst(String annoTypeName, Collection<? extends AnnotationAndValue> coll) Attempts to find the annotation in the provided collection.inthashCode()toString()typeName()The type name, e.g.,Objects-> "java.util.Objects".value()The value property.Get a value of an annotation property.values()Get a key-value of all the annotation properties.
-
Constructor Details
-
DefaultAnnotationAndValue
Ctor.- Parameters:
b- the builder- See Also:
-
-
Method Details
-
create
Creates an instance for an annotation with no value.- Parameters:
annoType- the annotation type- Returns:
- the new instance
-
create
Creates an instance for an annotation with no value.- Parameters:
annoType- the annotation type- Returns:
- the new instance
-
create
Creates an instance for an annotation with a value.- Parameters:
annoType- the annotation typevalue- the annotation value- Returns:
- the new instance
-
create
public static DefaultAnnotationAndValue create(Class<? extends Annotation> annoType, Map<String, String> values) Creates an instance for an annotation with a value.- Parameters:
annoType- the annotation typevalues- the annotation values- Returns:
- the new instance
-
create
Creates an instance for an annotation with a value.- Parameters:
annoTypeName- the annotation type namevalue- the annotation value- Returns:
- the new instance
-
create
Creates an instance for annotation with zero or more values.- Parameters:
annoTypeName- the annotation type namevalues- the annotation values- Returns:
- the new instance
-
findFirst
public static Optional<? extends AnnotationAndValue> findFirst(String annoTypeName, Collection<? extends AnnotationAndValue> coll) Attempts to find the annotation in the provided collection.- Parameters:
annoTypeName- the annotation type namecoll- the collection to search- Returns:
- the result of the find
-
builder
Creates a builder forAnnotationAndValue.- Returns:
- a fluent builder
-
toString
-
hashCode
public int hashCode() -
equals
-
typeName
Description copied from interface:AnnotationAndValueThe type name, e.g.,Objects-> "java.util.Objects".- Specified by:
typeNamein interfaceAnnotationAndValue- Returns:
- the annotation type name
-
value
Description copied from interface:AnnotationAndValueThe value property.- Specified by:
valuein interfaceAnnotationAndValue- Returns:
- The string value of value property
-
value
Description copied from interface:AnnotationAndValueGet a value of an annotation property.- Specified by:
valuein interfaceAnnotationAndValue- Parameters:
name- name of the annotation property- Returns:
- string value of the property
-
values
Description copied from interface:AnnotationAndValueGet a key-value of all the annotation properties.- Specified by:
valuesin interfaceAnnotationAndValue- Returns:
- key-value pairs of all the properties present
-
compareTo
- Specified by:
compareToin interfaceComparable<AnnotationAndValue>
-