Class PropertiesAttributes
java.lang.Object
dev.getelements.elements.sdk.util.PropertiesAttributes
- All Implemented Interfaces:
Attributes
,MutableAttributes
An instance of
Attributes
backed by a Properties
instance.-
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 TypeMethodDescriptionstatic PropertiesAttributes
copyOf
(Attributes attributes) Takes a copy of the suppliedAttributes
and returns a newPropertiesAttributes
.getAttributeOptional
(String name) Gets the attribute associated with thisAttributes
object.Returns a copy of thisAttributes
as an immutable copy.void
setAttribute
(String name, Object obj) Sets the attribute with the supplied name and valuestream()
Gets allAttributes.Attribute
s as aStream
.static PropertiesAttributes
wrap
(Properties properties) Wraps the providedProperties
in an instance ofMutableAttributes
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.sdk.Attributes
asMap, asProperties, asProperties, getAttribute
-
Method Details
-
copyOf
Takes a copy of the suppliedAttributes
and returns a newPropertiesAttributes
.- Parameters:
attributes
- theAttributes
to copy- Returns:
- the
PropertiesAttributes
-
wrap
Wraps the providedProperties
in an instance ofMutableAttributes
. Changes to the underlyingProperties
will be visible.- Parameters:
properties
- theProperties
to wrap- Returns:
- a wrapped instance of
MutableAttributes
-
getAttributeNames
Description copied from interface:Attributes
- Specified by:
getAttributeNames
in interfaceAttributes
- Returns:
- the
List<String>
of attribute names
-
stream
Description copied from interface:Attributes
Gets allAttributes.Attribute
s as aStream
.- Specified by:
stream
in interfaceAttributes
- Returns:
- a
Stream
ofAttributes.Attribute
s
-
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
-
setAttribute
Description copied from interface:MutableAttributes
Sets the attribute with the supplied name and value- Specified by:
setAttribute
in interfaceMutableAttributes
- Parameters:
name
- the name to setobj
- the value to set
-
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
-