Class ImmutableAttributes
java.lang.Object
dev.getelements.elements.sdk.util.ImmutableAttributes
- All Implemented Interfaces:
Attributes
A type of
Attributes
which is immutable.-
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
-
Method Summary
Modifier and TypeMethodDescriptionasMap()
Returns a view of thisAttributes
object as aMap<String,
.Object> static ImmutableAttributes
copyOf
(Attributes attributes) Takes a copy of the suppliedAttributes
and returns the result.boolean
getAttributeOptional
(String name) Gets the attribute associated with thisAttributes
object.int
hashCode()
Returns a copy of thisAttributes
as an immutable copy.stream()
Gets allAttributes.Attribute
s as aStream
.static ImmutableAttributes
Provides an immutable view of theMap
containing the attributes.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.sdk.Attributes
asProperties, asProperties, getAttribute
-
Method Details
-
viewOf
Provides an immutable view of theMap
containing the attributes.- Parameters:
attributes
- aMap
from which to provide the view of the attributes- Returns:
- an immutable view of the
Attributes
-
copyOf
Takes a copy of the suppliedAttributes
and returns the result.- Parameters:
attributes
- theAttributes
from which to copy this.- Returns:
- a copy of the
Attributes
-
immutableCopy
Description copied from interface:Attributes
Returns a copy of thisAttributes
as an immutable copy. Alternatively, if this instance is already immutable, then this will return this instance.- Specified by:
immutableCopy
in interfaceAttributes
- Returns:
- an immutable copy of this
Attributes
-
getAttributeNames
Description copied from interface:Attributes
- Specified by:
getAttributeNames
in interfaceAttributes
- Returns:
- the
List<String>
of attribute names
-
getAttributeOptional
Description copied from interface:Attributes
Gets the attribute associated with thisAttributes
object.- Specified by:
getAttributeOptional
in interfaceAttributes
- Parameters:
name
- the name of the attribute to fetch- Returns:
- an
Optional<Object>
for the value
-
asMap
Description copied from interface:Attributes
Returns a view of thisAttributes
object as aMap<String,
.Object> - Specified by:
asMap
in interfaceAttributes
- Returns:
- this
Attributes
as aMap<String,
Object>
-
stream
Description copied from interface:Attributes
Gets allAttributes.Attribute
s as aStream
.- Specified by:
stream
in interfaceAttributes
- Returns:
- a
Stream
ofAttributes.Attribute
s
-
equals
-
hashCode
public int hashCode()
-