Record Class InheritedMutableAttributes
java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.util.InheritedMutableAttributes
- Record Components:
base- the baseAttributesobjectcurrent- the currentMutableAttributesobject
- All Implemented Interfaces:
Attributes,MutableAttributes
public record InheritedMutableAttributes(Attributes base, MutableAttributes current)
extends Record
implements MutableAttributes
A set of attributes that inherits from a base set of attributes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.getelements.elements.sdk.Attributes
Attributes.Attribute<T> -
Field Summary
Fields inherited from interface dev.getelements.elements.sdk.Attributes
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionInheritedMutableAttributes(Attributes base, MutableAttributes current) Creates an instance of aInheritedMutableAttributesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbase()Returns the value of thebaserecord component.current()Returns the value of thecurrentrecord component.final booleanIndicates whether some other object is "equal to" this one.getAttributeOptional(String name) Gets the attribute associated with thisAttributesobject.final inthashCode()Returns a hash code value for this object.Returns a copy of thisAttributesas an immutable copy.newDerivativeFrom(Attributes attributes) Derives a new set of attributes from the current set of attributes.newDerivativeFrom(MutableAttributes attributes) Derives a new set of attributes from the current set of attributes.voidsetAttribute(String name, Object obj) Sets the attribute with the supplied name and valuefinal StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.getelements.elements.sdk.Attributes
asMap, asProperties, asProperties, getAttribute, stream
-
Constructor Details
-
Method Details
-
setAttribute
Description copied from interface:MutableAttributesSets the attribute with the supplied name and value- Specified by:
setAttributein interfaceMutableAttributes- Parameters:
name- the name to setobj- the value to set
-
getAttributeNames
Description copied from interface:Attributes- Specified by:
getAttributeNamesin interfaceAttributes- Returns:
- the
List<String>of attribute names
-
getAttributeOptional
Description copied from interface:AttributesGets the attribute associated with thisAttributesobject.- Specified by:
getAttributeOptionalin interfaceAttributes- Parameters:
name- the name of the attribute to fetch- Returns:
- an
Optional<Object>for the value
-
immutableCopy
Description copied from interface:AttributesReturns a copy of thisAttributesas an immutable copy. Alternatively, if this instance is already immutable, then this will return this instance.- Specified by:
immutableCopyin interfaceAttributes- Returns:
- an immutable copy of this
Attributes
-
newDerivativeFrom
Derives a new set of attributes from the current set of attributes.- Parameters:
attributes- the attributes- Returns:
- the new
InheritedAttributes
-
newDerivativeFrom
Derives a new set of attributes from the current set of attributes.- Parameters:
attributes- the attributes- Returns:
- the new
InheritedAttributes
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
base
Returns the value of thebaserecord component.- Returns:
- the value of the
baserecord component
-
current
Returns the value of thecurrentrecord component.- Returns:
- the value of the
currentrecord component
-