- java.lang.Object
-
- io.github.mmm.event.AbstractEventSource<ObservableEvent<V>,ObservableEventListener<? super V>>
-
- io.github.mmm.value.observable.AbstractObservableValue<V>
-
- io.github.mmm.value.observable.AbstractWritableObservableValue<V>
-
- io.github.mmm.property.Property<V>
-
- io.github.mmm.property.object.SimpleProperty<String>
-
- io.github.mmm.property.string.StringProperty
-
- io.github.mmm.property.string.StringListProperty
-
- All Implemented Interfaces:
EventSource<ObservableEvent<String>,ObservableEventListener<? super String>>
,MarshallableObject
,Marshaller<Object>
,Marshalling<Object>
,MarshallingObject
,UnmarshallableObject
,Unmarshaller<Object>
,ReadableSimpleProperty<String>
,WritableSimpleProperty<String>
,ReadableProperty<String>
,ReadableStringProperty
,WritableStringProperty
,WritableProperty<String>
,Validatable
,ComparableExpression<String>
,Expression<String>
,ObservableSimpleValue<String>
,ReadableSimpleValue<String>
,WritableSimpleValue<String>
,ObservableValue<String>
,ObservableStringValue
,ReadableStringValue
,StringExpression
,WritableStringValue
,WritableObservableValue<String>
,PropertyPath<String>
,ReadableTypedValue<String>
,ReadableValue<String>
,TypedPropertyPath<String>
,WritableValue<String>
,Cloneable
,Supplier<String>
public class StringListProperty extends StringProperty
This is an extension ofStringProperty
that stores a list ofString
values that are enclosed with pipe-symbols.- Since:
- 1.0.0
-
-
Field Summary
-
Fields inherited from interface io.github.mmm.property.WritableProperty
NO_PROPERTIES
-
-
Constructor Summary
Constructors Constructor Description StringListProperty(String name)
The constructor.StringListProperty(String name, PropertyMetadata<String> metadata)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(String element, boolean distinct)
boolean
contains(String element)
protected void
doSet(String newValue)
String
getValueAsCsv()
String
getValueAsCsv(String separator)
List<String>
getValueAsList()
Set<String>
getValueAsSet()
boolean
remove(String element)
void
setValueAsCollection(Collection<String> list)
void
setValueAsCsv(String csv)
void
setValueAsCsv(String csv, char separator)
void
setValueAsCsv(String csv, char separator, boolean trim)
-
Methods inherited from class io.github.mmm.property.string.StringProperty
doGet
-
Methods inherited from class io.github.mmm.property.object.SimpleProperty
read, write
-
Methods inherited from class io.github.mmm.property.Property
clearValidationResult, clone, copy, doValidate, doValidate, equals, get, getMetadata, getName, getReadOnly, hashCode, isReadOnly, isValid, isValueMutable, readObject, requireWritable, setWithChange, toString, validate, writeObject
-
Methods inherited from class io.github.mmm.value.observable.AbstractWritableObservableValue
bindInternal, bindOneWay, bindTwoWay, isBoundOneWay, isValueEqual, set, unbindOneWay, unbindTwoWay
-
Methods inherited from class io.github.mmm.value.observable.AbstractObservableValue
addListener, fireChange, fireEvent, fireEvent, fireEventFor, fireEventFor, fireEventWithOldValue, hasChangeAwareListeners, invalidate, removeListener, toString
-
Methods inherited from class io.github.mmm.event.AbstractEventSource
getEventAdapter, hasListeners
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.value.observable.comparable.ComparableExpression
greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo
-
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
-
Methods inherited from interface io.github.mmm.value.observable.Expression
asString, dispose, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotNull, isNull
-
Methods inherited from interface io.github.mmm.marshall.MarshallableObject
write, writeObject
-
Methods inherited from interface io.github.mmm.value.observable.ObservableValue
toString
-
Methods inherited from interface io.github.mmm.property.ReadableProperty
getMetadata, getName, isReadOnly, isTransient, isValid
-
Methods inherited from interface io.github.mmm.property.object.ReadableSimpleProperty
getValueType
-
Methods inherited from interface io.github.mmm.value.observable.string.ReadableStringValue
getAsString, getSafe, getValue, getValueClass
-
Methods inherited from interface io.github.mmm.value.ReadableValue
get
-
Methods inherited from interface io.github.mmm.value.observable.string.StringExpression
concat, isEmpty, isEqualToIgnoreCase, isEqualToIgnoreCase, isNotEmpty, isNotEqualToIgnoreCase, isNotEqualToIgnoreCase, length
-
Methods inherited from interface io.github.mmm.marshall.UnmarshallableObject
read, readObject
-
Methods inherited from interface io.github.mmm.validation.Validatable
validate
-
Methods inherited from interface io.github.mmm.value.observable.WritableObservableValue
bindOneWay, bindTwoWay, isBoundOneWay, unbindOneWay, unbindTwoWay
-
Methods inherited from interface io.github.mmm.property.WritableProperty
copy, getReadOnly
-
Methods inherited from interface io.github.mmm.value.observable.string.WritableStringValue
parse, setAsString, setValue
-
Methods inherited from interface io.github.mmm.value.WritableValue
set
-
-
-
-
Method Detail
-
doSet
protected void doSet(String newValue)
- Overrides:
doSet
in classStringProperty
- Parameters:
newValue
- the newvalue
to set.- See Also:
AbstractWritableObservableValue.set(Object)
-
remove
public boolean remove(String element)
- Parameters:
element
- the element to remove from thevalue as list
.- Returns:
true
if the given element was previously present and is now removed so the value actually has changed,false
otherwise (if not present and no change).- See Also:
List.remove(Object)
-
add
public boolean add(String element, boolean distinct)
- Parameters:
element
- the element to add to thevalue as list
.distinct
-true
if the value should be treated asSet
and this method should not change thevalue
if the givenelement
is alreadypresent
,false
otherwise.- Returns:
true
if thevalue
has changed,false
otherwise (ifdistinct
wastrue
and the givenelement
was alreadypresent
).- See Also:
List.add(Object)
-
contains
public boolean contains(String element)
- Parameters:
element
- the element to check.- Returns:
true
if the givenelement
is contained in thevalue as list
.- See Also:
List.contains(Object)
-
setValueAsCollection
public void setValueAsCollection(Collection<String> list)
- Parameters:
list
- theList
of elements to set as separatedstring value
.
-
getValueAsCsv
public String getValueAsCsv(String separator)
- Parameters:
separator
- the character used as separator.- Returns:
- the
value
with elements separated by the givenseparator
.
-
setValueAsCsv
public void setValueAsCsv(String csv)
- Parameters:
csv
- the newvalue
as comma separated value (e.g. "a,b,c").
-
setValueAsCsv
public void setValueAsCsv(String csv, char separator)
- Parameters:
csv
- the newvalue
with elements separated by the givenseparator
.separator
- the character used as separator.
-
-