Class PropertyBuilder<T>
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.memory.PropertyBuilder<T>
-
- Type Parameters:
T
-
public class PropertyBuilder<T> extends java.lang.Object
PropertyBuilder
for building in memoryPropertyState
instances.
-
-
Constructor Summary
Constructors Constructor Description PropertyBuilder(Type<T> type)
Create a new instance for buildingPropertyState
instances of the giventype
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull PropertyBuilder<T>
addValue(T value)
@NotNull PropertyBuilder<T>
addValues(java.lang.Iterable<T> values)
static <T> PropertyBuilder<T>
array(Type<T> type)
Create a new instance for building arrayPropertyState
instances of the giventype
.static <T> PropertyBuilder<T>
array(Type<T> type, java.lang.String name)
Create a new instance for building arrayPropertyState
instances of the giventype
.@NotNull PropertyBuilder<T>
assignFrom(PropertyState property)
static <T> PropertyBuilder<T>
copy(Type<T> type, PropertyState property)
Create a new instance for buildingPropertyState
instances of the giventype
.int
count()
java.lang.String
getName()
@NotNull PropertyState
getPropertyState()
T
getValue()
T
getValue(int index)
@NotNull java.util.List<T>
getValues()
boolean
hasValue(java.lang.Object value)
boolean
isArray()
boolean
isEmpty()
@NotNull PropertyBuilder<T>
removeValue(int index)
@NotNull PropertyBuilder<T>
removeValue(java.lang.Object value)
static <T> PropertyBuilder<T>
scalar(Type<T> type)
Create a new instance for building scalarPropertyState
instances of the giventype
.static <T> PropertyBuilder<T>
scalar(Type<T> type, java.lang.String name)
Create a new instance for building scalarPropertyState
instances of the giventype
.@NotNull PropertyBuilder<T>
setArray()
@NotNull PropertyBuilder<T>
setName(java.lang.String name)
@NotNull PropertyBuilder<T>
setScalar()
@NotNull PropertyBuilder<T>
setValue(T value)
@NotNull PropertyBuilder<T>
setValue(T value, int index)
@NotNull PropertyBuilder<T>
setValues(java.lang.Iterable<T> values)
-
-
-
Method Detail
-
scalar
public static <T> PropertyBuilder<T> scalar(Type<T> type)
Create a new instance for building scalarPropertyState
instances of the giventype
.- Parameters:
type
- type of thePropertyState
instances to be built.- Returns:
PropertyBuilder
fortype
-
array
public static <T> PropertyBuilder<T> array(Type<T> type)
Create a new instance for building arrayPropertyState
instances of the giventype
.- Parameters:
type
- type of thePropertyState
instances to be built.- Returns:
PropertyBuilder
fortype
-
scalar
public static <T> PropertyBuilder<T> scalar(Type<T> type, java.lang.String name)
Create a new instance for building scalarPropertyState
instances of the giventype
. The builder is initialised with the givenname
. Equivalent toMemoryPropertyBuilder.create(type).setName(name);
- Parameters:
type
- type of thePropertyState
instances to be built.name
- initial name- Returns:
PropertyBuilder
fortype
-
array
public static <T> PropertyBuilder<T> array(Type<T> type, java.lang.String name)
Create a new instance for building arrayPropertyState
instances of the giventype
. The builder is initialised with the givenname
. Equivalent toMemoryPropertyBuilder.create(type).setName(name).setArray();
- Parameters:
type
- type of thePropertyState
instances to be built.name
- initial name- Returns:
PropertyBuilder
fortype
-
copy
public static <T> PropertyBuilder<T> copy(Type<T> type, PropertyState property)
Create a new instance for buildingPropertyState
instances of the giventype
. The builder is initialised with the name and the values ofproperty
. Equivalent toPropertyBuilder.scalar(type).assignFrom(property);
- Parameters:
type
- type of thePropertyState
instances to be built.property
- initial name and values- Returns:
PropertyBuilder
fortype
-
getName
public java.lang.String getName()
-
getValue
public T getValue()
-
getValues
@NotNull public @NotNull java.util.List<T> getValues()
-
getValue
public T getValue(int index)
-
hasValue
public boolean hasValue(java.lang.Object value)
-
count
public int count()
-
isArray
public boolean isArray()
-
isEmpty
public boolean isEmpty()
-
getPropertyState
@NotNull public @NotNull PropertyState getPropertyState()
-
assignFrom
@NotNull public @NotNull PropertyBuilder<T> assignFrom(PropertyState property)
-
setName
@NotNull public @NotNull PropertyBuilder<T> setName(java.lang.String name)
-
setArray
@NotNull public @NotNull PropertyBuilder<T> setArray()
-
setScalar
@NotNull public @NotNull PropertyBuilder<T> setScalar()
-
setValue
@NotNull public @NotNull PropertyBuilder<T> setValue(T value)
-
addValue
@NotNull public @NotNull PropertyBuilder<T> addValue(T value)
-
addValues
@NotNull public @NotNull PropertyBuilder<T> addValues(java.lang.Iterable<T> values)
-
setValue
@NotNull public @NotNull PropertyBuilder<T> setValue(T value, int index)
-
setValues
@NotNull public @NotNull PropertyBuilder<T> setValues(java.lang.Iterable<T> values)
-
removeValue
@NotNull public @NotNull PropertyBuilder<T> removeValue(int index)
-
removeValue
@NotNull public @NotNull PropertyBuilder<T> removeValue(java.lang.Object value)
-
-