Package com.enonic.xp.data
Class PropertyTree
- java.lang.Object
-
- com.enonic.xp.data.PropertyTree
-
- All Implemented Interfaces:
java.io.Serializable
@PublicApi public final class PropertyTree extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PropertyTree()
Creates a new PropertyTree using a default PropertyIdProvider which uses UUID.randomUUID().
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Property
addBinaryReference(java.lang.String name, BinaryReference value)
Property[]
addBinaryReferences(java.lang.String name, BinaryReference... value)
Property
addBoolean(java.lang.String name, java.lang.Boolean value)
Property[]
addBooleans(java.lang.String name, java.lang.Boolean... value)
Property
addDouble(java.lang.String name, java.lang.Double value)
Property[]
addDoubles(java.lang.String name, java.lang.Double... value)
Property
addGeoPoint(java.lang.String name, GeoPoint value)
Property[]
addGeoPoints(java.lang.String name, GeoPoint... value)
Property
addInstant(java.lang.String name, java.time.Instant value)
Property[]
addInstants(java.lang.String name, java.time.Instant... value)
Property
addLink(java.lang.String name, Link value)
Property[]
addLinks(java.lang.String name, Link... value)
Property
addLocalDate(java.lang.String name, java.time.LocalDate value)
Property[]
addLocalDates(java.lang.String name, java.time.LocalDate... value)
Property
addLocalDateTime(java.lang.String name, java.time.LocalDateTime value)
Property[]
addLocalDateTimes(java.lang.String name, java.time.LocalDateTime... value)
Property
addLocalTime(java.lang.String name, java.time.LocalTime value)
Property[]
addLocalTimes(java.lang.String name, java.time.LocalTime... value)
Property
addLong(java.lang.String name, java.lang.Long value)
Property[]
addLongs(java.lang.String name, java.lang.Long... value)
Property
addProperty(java.lang.String name, Value value)
Property
addReference(java.lang.String name, Reference value)
Property[]
addReferences(java.lang.String name, Reference... value)
PropertySet
addSet(java.lang.String name)
Property
addSet(java.lang.String name, PropertySet value)
Property[]
addSets(java.lang.String name, PropertySet... value)
Property
addString(java.lang.String name, java.lang.String value)
Property[]
addStrings(java.lang.String name, java.lang.String... value)
Property[]
addStrings(java.lang.String name, java.util.Collection<java.lang.String> values)
Property
addXml(java.lang.String name, java.lang.String value)
Property[]
addXmls(java.lang.String name, java.lang.String... value)
PropertyTree
copy()
int
countNames(java.lang.String name)
boolean
equals(java.lang.Object o)
BinaryReference
getBinaryReference(PropertyPath path)
BinaryReference
getBinaryReference(java.lang.String path)
BinaryReference
getBinaryReference(java.lang.String name, int index)
java.lang.Iterable<BinaryReference>
getBinaryReferences(java.lang.String name)
java.lang.Boolean
getBoolean(PropertyPath path)
java.lang.Boolean
getBoolean(java.lang.String path)
java.lang.Boolean
getBoolean(java.lang.String name, int index)
java.lang.Iterable<java.lang.Boolean>
getBooleans(java.lang.String name)
java.lang.Double
getDouble(PropertyPath path)
java.lang.Double
getDouble(java.lang.String path)
java.lang.Double
getDouble(java.lang.String name, int index)
java.lang.Iterable<java.lang.Double>
getDoubles(java.lang.String name)
GeoPoint
getGeoPoint(PropertyPath path)
GeoPoint
getGeoPoint(java.lang.String path)
GeoPoint
getGeoPoint(java.lang.String name, int index)
java.lang.Iterable<GeoPoint>
getGeoPoints(java.lang.String name)
java.time.Instant
getInstant(PropertyPath path)
java.time.Instant
getInstant(java.lang.String path)
java.time.Instant
getInstant(java.lang.String name, int index)
java.lang.Iterable<java.time.Instant>
getInstants(java.lang.String name)
Link
getLink(PropertyPath path)
Link
getLink(java.lang.String path)
Link
getLink(java.lang.String name, int index)
java.lang.Iterable<Link>
getLinks(java.lang.String name)
java.time.LocalDate
getLocalDate(PropertyPath path)
java.time.LocalDate
getLocalDate(java.lang.String path)
java.time.LocalDate
getLocalDate(java.lang.String name, int index)
java.lang.Iterable<java.time.LocalDate>
getLocalDates(java.lang.String name)
java.time.LocalDateTime
getLocalDateTime(PropertyPath path)
java.time.LocalDateTime
getLocalDateTime(java.lang.String path)
java.time.LocalDateTime
getLocalDateTime(java.lang.String name, int index)
java.lang.Iterable<java.time.LocalDateTime>
getLocalDateTimes(java.lang.String name)
java.time.LocalTime
getLocalTime(PropertyPath path)
java.time.LocalTime
getLocalTime(java.lang.String path)
java.time.LocalTime
getLocalTime(java.lang.String name, int index)
java.lang.Iterable<java.time.LocalTime>
getLocalTimes(java.lang.String name)
java.lang.Long
getLong(PropertyPath path)
java.lang.Long
getLong(java.lang.String path)
java.lang.Long
getLong(java.lang.String name, int index)
java.lang.Iterable<java.lang.Long>
getLongs(java.lang.String name)
java.lang.Iterable<Property>
getProperties()
com.google.common.collect.ImmutableList<Property>
getProperties(ValueType valueType)
com.google.common.collect.ImmutableList<Property>
getProperties(java.lang.String name)
Property
getProperty(PropertyPath path)
Property
getProperty(java.lang.String path)
Property
getProperty(java.lang.String name, int index)
PropertySet
getPropertySet(PropertyPath path)
PropertySet
getPropertySet(java.lang.String path)
Reference
getReference(PropertyPath path)
Reference
getReference(java.lang.String path)
Reference
getReference(java.lang.String name, int index)
java.lang.Iterable<Reference>
getReferences(java.lang.String name)
PropertySet
getRoot()
PropertySet
getSet(PropertyPath path)
PropertySet
getSet(java.lang.String path)
PropertySet
getSet(java.lang.String name, int index)
java.lang.Iterable<PropertySet>
getSets(java.lang.String name)
java.lang.String
getString(PropertyPath path)
java.lang.String
getString(java.lang.String path)
java.lang.String
getString(java.lang.String name, int index)
java.lang.Iterable<java.lang.String>
getStrings(java.lang.String name)
int
getTotalSize()
Value
getValue(PropertyPath path)
Value
getValue(java.lang.String path)
Value
getValue(java.lang.String name, int index)
java.lang.Iterable<Value>
getValues(java.lang.String name)
int
hashCode()
boolean
hasProperty(PropertyPath path)
boolean
hasProperty(java.lang.String path)
boolean
hasProperty(java.lang.String name, int index)
PropertyTree
ifNotNull()
PropertySet
newSet()
PropertySet
newSet(PropertyTree source)
void
removeProperties(java.lang.String name)
void
removeProperty(PropertyPath path)
void
removeProperty(java.lang.String path)
Property
setBinaryReference(PropertyPath path, BinaryReference value)
Property
setBinaryReference(java.lang.String name, int index, BinaryReference value)
Property
setBinaryReference(java.lang.String path, BinaryReference value)
Property
setBoolean(PropertyPath path, java.lang.Boolean value)
Property
setBoolean(java.lang.String name, int index, java.lang.Boolean value)
Property
setBoolean(java.lang.String path, java.lang.Boolean value)
Property
setDouble(PropertyPath path, java.lang.Double value)
Property
setDouble(java.lang.String name, int index, java.lang.Double value)
Property
setDouble(java.lang.String path, java.lang.Double value)
Property
setGeoPoint(PropertyPath path, GeoPoint value)
Property
setGeoPoint(java.lang.String name, int index, GeoPoint value)
Property
setGeoPoint(java.lang.String path, GeoPoint value)
Property
setInstant(PropertyPath path, java.time.Instant value)
Property
setInstant(java.lang.String name, int index, java.time.Instant value)
Property
setInstant(java.lang.String path, java.time.Instant value)
Property
setLink(PropertyPath path, Link value)
Property
setLink(java.lang.String name, int index, Link value)
Property
setLink(java.lang.String path, Link value)
Property
setLocalDate(PropertyPath path, java.time.LocalDate value)
Property
setLocalDate(java.lang.String name, int index, java.time.LocalDate value)
Property
setLocalDate(java.lang.String path, java.time.LocalDate value)
Property
setLocalDateTime(PropertyPath path, java.time.LocalDateTime value)
Property
setLocalDateTime(java.lang.String name, int index, java.time.LocalDateTime value)
Property
setLocalDateTime(java.lang.String name, int index, java.time.LocalTime value)
Property
setLocalDateTime(java.lang.String path, java.time.LocalDateTime value)
Property
setLocalTime(PropertyPath path, java.time.LocalTime value)
Property
setLocalTime(java.lang.String path, java.time.LocalTime value)
Property
setLong(PropertyPath path, java.lang.Long value)
Property
setLong(java.lang.String name, int index, java.lang.Long value)
Property
setLong(java.lang.String path, java.lang.Long value)
Property
setProperty(PropertyPath path, Value value)
Property
setProperty(java.lang.String name, int index, Value value)
Property
setProperty(java.lang.String path, Value value)
Property
setReference(PropertyPath path, Reference value)
Property
setReference(java.lang.String name, int index, Reference value)
Property
setReference(java.lang.String path, Reference value)
Property
setSet(PropertyPath path, PropertySet value)
Property
setSet(java.lang.String name, int index, PropertySet value)
Property
setSet(java.lang.String path, PropertySet value)
Property
setString(PropertyPath path, java.lang.String value)
Property
setString(java.lang.String name, int index, java.lang.String value)
Property
setString(java.lang.String path, java.lang.String value)
void
setValues(PropertyPath path, java.lang.Iterable<Value> values)
void
setValues(java.lang.String path, java.lang.Iterable<Value> values)
Property
setXml(PropertyPath path, java.lang.String value)
Property
setXml(java.lang.String name, int index, java.lang.String value)
Property
setXml(java.lang.String path, java.lang.String value)
java.util.Map<java.lang.String,java.lang.Object>
toMap()
java.lang.String
toString()
-
-
-
Method Detail
-
toMap
public java.util.Map<java.lang.String,java.lang.Object> toMap()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
copy
public PropertyTree copy()
-
getProperties
public com.google.common.collect.ImmutableList<Property> getProperties(ValueType valueType)
-
ifNotNull
public PropertyTree ifNotNull()
-
newSet
public PropertySet newSet()
-
newSet
public PropertySet newSet(PropertyTree source)
-
countNames
public int countNames(java.lang.String name)
-
setProperty
public Property setProperty(PropertyPath path, Value value)
-
setValues
public void setValues(java.lang.String path, java.lang.Iterable<Value> values)
-
setValues
public void setValues(PropertyPath path, java.lang.Iterable<Value> values)
-
removeProperty
public void removeProperty(java.lang.String path)
-
removeProperty
public void removeProperty(PropertyPath path)
-
removeProperties
public void removeProperties(java.lang.String name)
-
getRoot
public PropertySet getRoot()
-
hasProperty
public boolean hasProperty(java.lang.String path)
-
hasProperty
public boolean hasProperty(PropertyPath path)
-
hasProperty
public boolean hasProperty(java.lang.String name, int index)
-
getProperty
public Property getProperty(java.lang.String name, int index)
-
getProperty
public Property getProperty(PropertyPath path)
-
getProperty
public Property getProperty(java.lang.String path)
-
getProperties
public com.google.common.collect.ImmutableList<Property> getProperties(java.lang.String name)
-
getProperties
public java.lang.Iterable<Property> getProperties()
-
getValue
public Value getValue(java.lang.String name, int index)
-
getValue
public Value getValue(PropertyPath path)
-
getValue
public Value getValue(java.lang.String path)
-
getValues
public java.lang.Iterable<Value> getValues(java.lang.String name)
-
getPropertySet
public PropertySet getPropertySet(PropertyPath path)
-
getPropertySet
public PropertySet getPropertySet(java.lang.String path)
-
getTotalSize
public int getTotalSize()
-
setSet
public Property setSet(PropertyPath path, PropertySet value)
-
setSet
public Property setSet(java.lang.String path, PropertySet value)
-
setSet
public Property setSet(java.lang.String name, int index, PropertySet value)
-
addSet
public Property addSet(java.lang.String name, PropertySet value)
-
addSets
public Property[] addSets(java.lang.String name, PropertySet... value)
-
addSet
public PropertySet addSet(java.lang.String name)
-
setString
public Property setString(PropertyPath path, java.lang.String value)
-
setString
public Property setString(java.lang.String path, java.lang.String value)
-
setString
public Property setString(java.lang.String name, int index, java.lang.String value)
-
addString
public Property addString(java.lang.String name, java.lang.String value)
-
addStrings
public Property[] addStrings(java.lang.String name, java.lang.String... value)
-
addStrings
public Property[] addStrings(java.lang.String name, java.util.Collection<java.lang.String> values)
-
setXml
public Property setXml(PropertyPath path, java.lang.String value)
-
setXml
public Property setXml(java.lang.String path, java.lang.String value)
-
setXml
public Property setXml(java.lang.String name, int index, java.lang.String value)
-
addXml
public Property addXml(java.lang.String name, java.lang.String value)
-
addXmls
public Property[] addXmls(java.lang.String name, java.lang.String... value)
-
setBinaryReference
public Property setBinaryReference(PropertyPath path, BinaryReference value)
-
setBinaryReference
public Property setBinaryReference(java.lang.String path, BinaryReference value)
-
setBinaryReference
public Property setBinaryReference(java.lang.String name, int index, BinaryReference value)
-
addBinaryReference
public Property addBinaryReference(java.lang.String name, BinaryReference value)
-
addBinaryReferences
public Property[] addBinaryReferences(java.lang.String name, BinaryReference... value)
-
setReference
public Property setReference(PropertyPath path, Reference value)
-
setLink
public Property setLink(PropertyPath path, Link value)
-
setBoolean
public Property setBoolean(PropertyPath path, java.lang.Boolean value)
-
setBoolean
public Property setBoolean(java.lang.String path, java.lang.Boolean value)
-
setBoolean
public Property setBoolean(java.lang.String name, int index, java.lang.Boolean value)
-
addBoolean
public Property addBoolean(java.lang.String name, java.lang.Boolean value)
-
addBooleans
public Property[] addBooleans(java.lang.String name, java.lang.Boolean... value)
-
setLong
public Property setLong(PropertyPath path, java.lang.Long value)
-
setLong
public Property setLong(java.lang.String path, java.lang.Long value)
-
setLong
public Property setLong(java.lang.String name, int index, java.lang.Long value)
-
addLong
public Property addLong(java.lang.String name, java.lang.Long value)
-
addLongs
public Property[] addLongs(java.lang.String name, java.lang.Long... value)
-
setDouble
public Property setDouble(PropertyPath path, java.lang.Double value)
-
setDouble
public Property setDouble(java.lang.String path, java.lang.Double value)
-
setDouble
public Property setDouble(java.lang.String name, int index, java.lang.Double value)
-
addDouble
public Property addDouble(java.lang.String name, java.lang.Double value)
-
addDoubles
public Property[] addDoubles(java.lang.String name, java.lang.Double... value)
-
setGeoPoint
public Property setGeoPoint(PropertyPath path, GeoPoint value)
-
setLocalDate
public Property setLocalDate(PropertyPath path, java.time.LocalDate value)
-
setLocalDate
public Property setLocalDate(java.lang.String path, java.time.LocalDate value)
-
setLocalDate
public Property setLocalDate(java.lang.String name, int index, java.time.LocalDate value)
-
addLocalDate
public Property addLocalDate(java.lang.String name, java.time.LocalDate value)
-
addLocalDates
public Property[] addLocalDates(java.lang.String name, java.time.LocalDate... value)
-
setLocalDateTime
public Property setLocalDateTime(PropertyPath path, java.time.LocalDateTime value)
-
setLocalDateTime
public Property setLocalDateTime(java.lang.String path, java.time.LocalDateTime value)
-
setLocalDateTime
public Property setLocalDateTime(java.lang.String name, int index, java.time.LocalDateTime value)
-
addLocalDateTime
public Property addLocalDateTime(java.lang.String name, java.time.LocalDateTime value)
-
addLocalDateTimes
public Property[] addLocalDateTimes(java.lang.String name, java.time.LocalDateTime... value)
-
setLocalTime
public Property setLocalTime(PropertyPath path, java.time.LocalTime value)
-
setLocalTime
public Property setLocalTime(java.lang.String path, java.time.LocalTime value)
-
setLocalDateTime
public Property setLocalDateTime(java.lang.String name, int index, java.time.LocalTime value)
-
addLocalTime
public Property addLocalTime(java.lang.String name, java.time.LocalTime value)
-
addLocalTimes
public Property[] addLocalTimes(java.lang.String name, java.time.LocalTime... value)
-
setInstant
public Property setInstant(PropertyPath path, java.time.Instant value)
-
setInstant
public Property setInstant(java.lang.String path, java.time.Instant value)
-
setInstant
public Property setInstant(java.lang.String name, int index, java.time.Instant value)
-
addInstant
public Property addInstant(java.lang.String name, java.time.Instant value)
-
addInstants
public Property[] addInstants(java.lang.String name, java.time.Instant... value)
-
getSet
public PropertySet getSet(java.lang.String name, int index)
-
getSet
public PropertySet getSet(PropertyPath path)
-
getSet
public PropertySet getSet(java.lang.String path)
-
getSets
public java.lang.Iterable<PropertySet> getSets(java.lang.String name)
-
getString
public java.lang.String getString(java.lang.String name, int index)
-
getString
public java.lang.String getString(PropertyPath path)
-
getString
public java.lang.String getString(java.lang.String path)
-
getStrings
public java.lang.Iterable<java.lang.String> getStrings(java.lang.String name)
-
getBoolean
public java.lang.Boolean getBoolean(java.lang.String name, int index)
-
getBoolean
public java.lang.Boolean getBoolean(PropertyPath path)
-
getBoolean
public java.lang.Boolean getBoolean(java.lang.String path)
-
getBooleans
public java.lang.Iterable<java.lang.Boolean> getBooleans(java.lang.String name)
-
getLong
public java.lang.Long getLong(java.lang.String name, int index)
-
getLong
public java.lang.Long getLong(PropertyPath path)
-
getLong
public java.lang.Long getLong(java.lang.String path)
-
getLongs
public java.lang.Iterable<java.lang.Long> getLongs(java.lang.String name)
-
getDouble
public java.lang.Double getDouble(java.lang.String name, int index)
-
getDouble
public java.lang.Double getDouble(PropertyPath path)
-
getDouble
public java.lang.Double getDouble(java.lang.String path)
-
getDoubles
public java.lang.Iterable<java.lang.Double> getDoubles(java.lang.String name)
-
getGeoPoint
public GeoPoint getGeoPoint(java.lang.String name, int index)
-
getGeoPoint
public GeoPoint getGeoPoint(PropertyPath path)
-
getGeoPoint
public GeoPoint getGeoPoint(java.lang.String path)
-
getGeoPoints
public java.lang.Iterable<GeoPoint> getGeoPoints(java.lang.String name)
-
getBinaryReference
public BinaryReference getBinaryReference(java.lang.String name, int index)
-
getBinaryReference
public BinaryReference getBinaryReference(PropertyPath path)
-
getBinaryReference
public BinaryReference getBinaryReference(java.lang.String path)
-
getBinaryReferences
public java.lang.Iterable<BinaryReference> getBinaryReferences(java.lang.String name)
-
getLink
public Link getLink(java.lang.String name, int index)
-
getLink
public Link getLink(PropertyPath path)
-
getLink
public Link getLink(java.lang.String path)
-
getLinks
public java.lang.Iterable<Link> getLinks(java.lang.String name)
-
getReference
public Reference getReference(java.lang.String name, int index)
-
getReference
public Reference getReference(PropertyPath path)
-
getReference
public Reference getReference(java.lang.String path)
-
getReferences
public java.lang.Iterable<Reference> getReferences(java.lang.String name)
-
getLocalDate
public java.time.LocalDate getLocalDate(java.lang.String name, int index)
-
getLocalDate
public java.time.LocalDate getLocalDate(PropertyPath path)
-
getLocalDate
public java.time.LocalDate getLocalDate(java.lang.String path)
-
getLocalDates
public java.lang.Iterable<java.time.LocalDate> getLocalDates(java.lang.String name)
-
getLocalDateTime
public java.time.LocalDateTime getLocalDateTime(java.lang.String name, int index)
-
getLocalDateTime
public java.time.LocalDateTime getLocalDateTime(PropertyPath path)
-
getLocalDateTime
public java.time.LocalDateTime getLocalDateTime(java.lang.String path)
-
getLocalDateTimes
public java.lang.Iterable<java.time.LocalDateTime> getLocalDateTimes(java.lang.String name)
-
getLocalTime
public java.time.LocalTime getLocalTime(java.lang.String name, int index)
-
getLocalTime
public java.time.LocalTime getLocalTime(PropertyPath path)
-
getLocalTime
public java.time.LocalTime getLocalTime(java.lang.String path)
-
getLocalTimes
public java.lang.Iterable<java.time.LocalTime> getLocalTimes(java.lang.String name)
-
getInstant
public java.time.Instant getInstant(java.lang.String name, int index)
-
getInstant
public java.time.Instant getInstant(PropertyPath path)
-
getInstant
public java.time.Instant getInstant(java.lang.String path)
-
getInstants
public java.lang.Iterable<java.time.Instant> getInstants(java.lang.String name)
-
-