java.lang.Object
java.lang.Record
org.microbean.qualifier.NamedAttributeMap<V>
- All Implemented Interfaces:
Comparable<NamedAttributeMap<V>>
,Constable
,org.microbean.invoke.ContentHashable
public record NamedAttributeMap<V>(String name, Map<String,V> attributes, Map<String,V> info, Collection<NamedAttributeMap<V>> metadata)
extends Record
implements Comparable<NamedAttributeMap<V>>, Constable, org.microbean.invoke.ContentHashable
-
Constructor Summary
ConstructorDescriptionNamedAttributeMap
(String name) NamedAttributeMap
(String name, Map<String, V> attributes) NamedAttributeMap
(String name, Map<String, V> attributes, Map<String, V> info, Collection<NamedAttributeMap<V>> metadata) Creates an instance of aNamedAttributeMap
record class.NamedAttributeMap
(String name, V value) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributes
record component.final int
compareTo
(NamedAttributeMap<V> other) final boolean
final Optional<DynamicConstantDesc<NamedAttributeMap<V>>>
final boolean
Indicates whether some other object is "equal to" this one.final V
final int
hashCode()
Returns a hash code value for this object.info()
Returns the value of theinfo
record component.final boolean
isEmpty()
metadata()
Returns the value of themetadata
record component.name()
Returns the value of thename
record component.static final <V> NamedAttributeMap<V>
of
(String name, Map<String, V> attributes, Map<String, V> info, Collection<NamedAttributeMap<V>> metadata) final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
NamedAttributeMap
-
NamedAttributeMap
-
NamedAttributeMap
-
NamedAttributeMap
public NamedAttributeMap(String name, Map<String, V> attributes, Map<String, V> info, Collection<NamedAttributeMap<V>> metadata) Creates an instance of aNamedAttributeMap
record class.- Parameters:
name
- the value for thename
record componentattributes
- the value for theattributes
record componentinfo
- the value for theinfo
record componentmetadata
- the value for themetadata
record component
-
-
Method Details
-
isEmpty
-
containsKey
-
get
-
contentHashInput
- Specified by:
contentHashInput
in interfaceorg.microbean.invoke.ContentHashable
-
compareTo
- Specified by:
compareTo
in interfaceComparable<V>
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
describeConstable
- Specified by:
describeConstable
in interfaceConstable
-
of
public static final <V> NamedAttributeMap<V> of(String name, Map<String, V> attributes, Map<String, V> info, Collection<NamedAttributeMap<V>> metadata) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
attributes
Returns the value of theattributes
record component.- Returns:
- the value of the
attributes
record component
-
info
Returns the value of theinfo
record component.- Returns:
- the value of the
info
record component
-
metadata
Returns the value of themetadata
record component.- Returns:
- the value of the
metadata
record component
-