@Immutable public class BasicSingleValueProperty extends BasicProperty
| Modifier and Type | Class and Description |
|---|---|
protected class |
BasicSingleValueProperty.ValueIterator |
Property.ValueTypeTransformer<T>| Constructor and Description |
|---|
BasicSingleValueProperty(Name name,
Object value)
Create a property with a single value
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getFirstValue()
Obtain the property's first value in its natural form.
|
Object |
getValue(int index)
Returns the value of the property at the given index.
|
boolean |
isBinary()
Determine whether this property is a binary property or not.
|
boolean |
isEmpty()
Determine whether this property has no actual values.
|
boolean |
isMultiple()
Determine whether the property currently has multiple values.
|
boolean |
isReference()
Determine whether this property contains reference values, based upon the first value in the property.
|
boolean |
isSimpleReference()
Determine whether this property contains simple reference values, based upon the first value in the property.
|
boolean |
isSingle()
Determine whether the property currently has a single value.
|
Iterator<Object> |
iterator() |
int |
size()
Get the number of actual values in this property.
|
compareTo, equals, getName, getString, getString, getString, getString, getString, getValues, getValuesAsArray, getValuesAsArray, getValuesAsArray, hashCode, toStringprotected final Object value
public boolean isEmpty()
Propertytrue regardless of whether the
property allows a single value, or multiple values.
This method is a convenience method that is equivalent to size() == 0.
Property.isMultiple(),
Property.isSingle()public boolean isMultiple()
PropertyProperty.isSingle(),
Property.isEmpty()public boolean isSingle()
PropertyProperty.isMultiple(),
Property.isEmpty()public boolean isReference()
PropertyPropertyType.SIMPLEREFERENCE properties *are not* treated as references in order to avoid setting the
back-pointer.public boolean isSimpleReference()
PropertyPropertyType.SIMPLEREFERENCEpublic boolean isBinary()
Propertypublic int size()
Propertymultiple values, then this
method may return a value greater than 1. If the property only allows a single value, then this method
will return either 0 or 1. This method may return 0 regardless of whether the property allows a single
value, or multiple values.public Object getFirstValue()
PropertyisEmpty() ? null : iterator().next()emptyIterable.iterator(),
Property.getValues(),
Property.getValuesAsArray(),
Property.isEmpty()public Object getValue(int index) throws IndexOutOfBoundsException
Propertyindex - an int representing the index at which to retrieve the value. If the value is 0, this is
equivalent to calling Property.getFirstValue()null if the property is empty.IndexOutOfBoundsException - if the given index is outside the interval of values of the property.Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.