@Immutable public class BasicEmptyProperty extends BasicProperty
Modifier and Type | Class and Description |
---|---|
protected static class |
BasicEmptyProperty.EmptyIterator<T> |
Property.ValueTypeTransformer<T>
Constructor and Description |
---|
BasicEmptyProperty(Name name)
Create a property with no values.
|
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, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public BasicEmptyProperty(Name name)
name
- the property namepublic boolean isEmpty()
Property
true
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()
Property
Property.isSingle()
,
Property.isEmpty()
public boolean isSingle()
Property
Property.isMultiple()
,
Property.isEmpty()
public boolean isReference()
Property
PropertyType.SIMPLEREFERENCE
properties *are not* treated as references in order to avoid setting the
back-pointer.public boolean isSimpleReference()
Property
PropertyType.SIMPLEREFERENCE
public boolean isBinary()
Property
public int size()
Property
multiple 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()
Property
isEmpty() ? null : iterator().next()
empty
Iterable.iterator()
,
Property.getValues()
,
Property.getValuesAsArray()
,
Property.isEmpty()
public Object getValue(int index) throws IndexOutOfBoundsException
Property
index
- 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–2016 JBoss, a division of Red Hat. All rights reserved.