T - public class PropertyBuilder<T> extends Object
PropertyBuilder for building in memory PropertyState instances.| Constructor and Description |
|---|
PropertyBuilder(org.apache.jackrabbit.oak.api.Type<T> type)
Create a new instance for building
PropertyState instances
of the given type. |
| Modifier and Type | Method and Description |
|---|---|
@NotNull PropertyBuilder<T> |
addValue(T value) |
@NotNull PropertyBuilder<T> |
addValues(Iterable<T> values) |
static <T> PropertyBuilder<T> |
array(org.apache.jackrabbit.oak.api.Type<T> type)
Create a new instance for building array
PropertyState instances
of the given type. |
static <T> PropertyBuilder<T> |
array(org.apache.jackrabbit.oak.api.Type<T> type,
String name)
Create a new instance for building array
PropertyState instances
of the given type. |
@NotNull PropertyBuilder<T> |
assignFrom(org.apache.jackrabbit.oak.api.PropertyState property) |
static <T> PropertyBuilder<T> |
copy(org.apache.jackrabbit.oak.api.Type<T> type,
org.apache.jackrabbit.oak.api.PropertyState property)
Create a new instance for building
PropertyState instances
of the given type. |
int |
count() |
String |
getName() |
@NotNull org.apache.jackrabbit.oak.api.PropertyState |
getPropertyState() |
T |
getValue() |
T |
getValue(int index) |
@NotNull List<T> |
getValues() |
boolean |
hasValue(Object value) |
boolean |
isArray() |
boolean |
isEmpty() |
@NotNull PropertyBuilder<T> |
removeValue(int index) |
@NotNull PropertyBuilder<T> |
removeValue(Object value) |
static <T> PropertyBuilder<T> |
scalar(org.apache.jackrabbit.oak.api.Type<T> type)
Create a new instance for building scalar
PropertyState instances
of the given type. |
static <T> PropertyBuilder<T> |
scalar(org.apache.jackrabbit.oak.api.Type<T> type,
String name)
Create a new instance for building scalar
PropertyState instances
of the given type. |
@NotNull PropertyBuilder<T> |
setArray() |
@NotNull PropertyBuilder<T> |
setName(String name) |
@NotNull PropertyBuilder<T> |
setScalar() |
@NotNull PropertyBuilder<T> |
setValue(T value) |
@NotNull PropertyBuilder<T> |
setValue(T value,
int index) |
@NotNull PropertyBuilder<T> |
setValues(Iterable<T> values) |
public PropertyBuilder(org.apache.jackrabbit.oak.api.Type<T> type)
PropertyState instances
of the given type.type - type of the PropertyState instances to be built.IllegalArgumentException - if type.isArray() is true.public static <T> PropertyBuilder<T> scalar(org.apache.jackrabbit.oak.api.Type<T> type)
PropertyState instances
of the given type.type - type of the PropertyState instances to be built.PropertyBuilder for typepublic static <T> PropertyBuilder<T> array(org.apache.jackrabbit.oak.api.Type<T> type)
PropertyState instances
of the given type.type - type of the PropertyState instances to be built.PropertyBuilder for typepublic static <T> PropertyBuilder<T> scalar(org.apache.jackrabbit.oak.api.Type<T> type, String name)
PropertyState instances
of the given type. The builder is initialised with the
given name.
Equivalent to
MemoryPropertyBuilder.create(type).setName(name);
type - type of the PropertyState instances to be built.name - initial namePropertyBuilder for typepublic static <T> PropertyBuilder<T> array(org.apache.jackrabbit.oak.api.Type<T> type, String name)
PropertyState instances
of the given type. The builder is initialised with the
given name.
Equivalent to
MemoryPropertyBuilder.create(type).setName(name).setArray();
type - type of the PropertyState instances to be built.name - initial namePropertyBuilder for typepublic static <T> PropertyBuilder<T> copy(org.apache.jackrabbit.oak.api.Type<T> type, org.apache.jackrabbit.oak.api.PropertyState property)
PropertyState instances
of the given type. The builder is initialised with the name and
the values of property.
Equivalent to
PropertyBuilder.scalar(type).assignFrom(property);
type - type of the PropertyState instances to be built.property - initial name and valuesPropertyBuilder for typepublic String getName()
public T getValue()
public T getValue(int index)
public boolean hasValue(Object value)
public int count()
public boolean isArray()
public boolean isEmpty()
@NotNull public @NotNull org.apache.jackrabbit.oak.api.PropertyState getPropertyState()
@NotNull public @NotNull PropertyBuilder<T> assignFrom(org.apache.jackrabbit.oak.api.PropertyState property)
@NotNull public @NotNull PropertyBuilder<T> setName(String name)
@NotNull public @NotNull PropertyBuilder<T> setArray()
@NotNull public @NotNull PropertyBuilder<T> setScalar()
@NotNull public @NotNull PropertyBuilder<T> setValue(T value)
@NotNull public @NotNull PropertyBuilder<T> addValue(T value)
@NotNull public @NotNull PropertyBuilder<T> addValues(Iterable<T> values)
@NotNull public @NotNull PropertyBuilder<T> setValue(T value, int index)
@NotNull public @NotNull PropertyBuilder<T> setValues(Iterable<T> values)
@NotNull public @NotNull PropertyBuilder<T> removeValue(int index)
@NotNull public @NotNull PropertyBuilder<T> removeValue(Object value)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.