Package org.silverpeas.core.calendar
Class AttributeSet
- java.lang.Object
-
- org.silverpeas.core.calendar.AttributeSet
-
- All Implemented Interfaces:
Serializable
,Iterable<Map.Entry<String,String>>
@Embeddable public class AttributeSet extends Object implements Serializable, Iterable<Map.Entry<String,String>>
A set of attributes of aPlannableOnCalendar
object. An attribute is an additional information carried by aPlannableOnCalendar
object. This is a way to users to specify additional attributes that weren't defined into aPlannableOnCalendar
implementation. For example, for an event, the location of the event can be set as an attribute.- Author:
- mmoquillon
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AttributeSet()
Constructs an empty attribute container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllFrom(AttributeSet attributes)
Adds to this attributes all those from the specified ones.AttributeSet
copy()
Copies this object into another one.boolean
equals(Object o)
void
forEach(Consumer<? super Map.Entry<String,String>> action)
Optional<String>
get(String name)
Gets the value of the specified attribute or nothing is there is no a such attribute.int
hashCode()
boolean
isEmpty()
Is this set of attributes empty?Iterator<Map.Entry<String,String>>
iterator()
void
remove(String name)
Remove the specified attribute.AttributeSet
removeIf(Predicate<Map.Entry<String,String>> filter)
Removes all of the attributes that match the specified filter.void
set(String name, String value)
Sets the specified attributes.void
setAllFrom(AttributeSet attributes)
Sets to this attributes all those from the specified ones.Spliterator<Map.Entry<String,String>>
spliterator()
Stream<Map.Entry<String,String>>
stream()
Streams the attendees in this calendar component.
-
-
-
Method Detail
-
spliterator
public Spliterator<Map.Entry<String,String>> spliterator()
- Specified by:
spliterator
in interfaceIterable<Map.Entry<String,String>>
-
stream
public Stream<Map.Entry<String,String>> stream()
Streams the attendees in this calendar component.- Returns:
- a
Stream
with the attendees in this calendar component.
-
set
public void set(String name, String value)
Sets the specified attributes.- Parameters:
name
- the attribute name.value
- the attribute value.
-
remove
public void remove(String name)
Remove the specified attribute.- Parameters:
name
- the name of the attribute to remove.
-
removeIf
public AttributeSet removeIf(Predicate<Map.Entry<String,String>> filter)
Removes all of the attributes that match the specified filter.- Parameters:
filter
- the predicate against which each attribute is filtered.- Returns:
- the updated attributes in this calendar component.
-
isEmpty
public boolean isEmpty()
Is this set of attributes empty?- Returns:
- true if there is no attributes set, false otherwise.
-
get
public Optional<String> get(String name)
Gets the value of the specified attribute or nothing is there is no a such attribute.- Parameters:
name
- the name of an attribute.- Returns:
- optionally the value of the specified attribute.
-
addAllFrom
public void addAllFrom(AttributeSet attributes)
Adds to this attributes all those from the specified ones.- Parameters:
attributes
- the attributes to add.
-
setAllFrom
public void setAllFrom(AttributeSet attributes)
Sets to this attributes all those from the specified ones.- Parameters:
attributes
- the attributes to add.
-
copy
public AttributeSet copy()
Copies this object into another one.- Returns:
- the copied object.
-
-