Package com.enonic.xp.data

## Class PropertyTree

- java.lang.Object
- - com.enonic.xp.data.PropertyTree

- All Implemented Interfaces:
    `Serializable`

      @PublicApi
      public final class PropertyTree
      extends Object
      implements 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​(String name, BinaryReference value)` |
    `Property[]` | `addBinaryReferences​(String name, BinaryReference... value)` |
    `Property` | `addBoolean​(String name, Boolean value)` |
    `Property[]` | `addBooleans​(String name, Boolean... value)` |
    `Property` | `addDouble​(String name, Double value)` |
    `Property[]` | `addDoubles​(String name, Double... value)` |
    `Property` | `addGeoPoint​(String name, GeoPoint value)` |
    `Property[]` | `addGeoPoints​(String name, GeoPoint... value)` |
    `Property` | `addInstant​(String name, Instant value)` |
    `Property[]` | `addInstants​(String name, Instant... value)` |
    `Property` | `addLink​(String name, Link value)` |
    `Property[]` | `addLinks​(String name, Link... value)` |
    `Property` | `addLocalDate​(String name, LocalDate value)` |
    `Property[]` | `addLocalDates​(String name, LocalDate... value)` |
    `Property` | `addLocalDateTime​(String name, LocalDateTime value)` |
    `Property[]` | `addLocalDateTimes​(String name, LocalDateTime... value)` |
    `Property` | `addLocalTime​(String name, LocalTime value)` |
    `Property[]` | `addLocalTimes​(String name, LocalTime... value)` |
    `Property` | `addLong​(String name, Long value)` |
    `Property[]` | `addLongs​(String name, Long... value)` |
    `Property` | `addProperty​(String name, Value value)` |
    `Property` | `addReference​(String name, Reference value)` |
    `Property[]` | `addReferences​(String name, Reference... value)` |
    `PropertySet` | `addSet​(String name)` |
    `Property` | `addSet​(String name, PropertySet value)` |
    `Property[]` | `addSets​(String name, PropertySet... value)` |
    `Property` | `addString​(String name, String value)` |
    `Property[]` | `addStrings​(String name, String... value)` |
    `Property[]` | `addStrings​(String name, Collection<String> values)` |
    `Property` | `addXml​(String name, String value)` |
    `Property[]` | `addXmls​(String name, String... value)` |
    `PropertyTree` | `copy()` |
    `int` | `countNames​(String name)` |
    `boolean` | `equals​(Object o)` |
    `BinaryReference` | `getBinaryReference​(PropertyPath path)` |
    `BinaryReference` | `getBinaryReference​(String path)` |
    `BinaryReference` | `getBinaryReference​(String name, int index)` |
    `Iterable<BinaryReference>` | `getBinaryReferences​(String name)` |
    `Boolean` | `getBoolean​(PropertyPath path)` |
    `Boolean` | `getBoolean​(String path)` |
    `Boolean` | `getBoolean​(String name, int index)` |
    `Iterable<Boolean>` | `getBooleans​(String name)` |
    `Double` | `getDouble​(PropertyPath path)` |
    `Double` | `getDouble​(String path)` |
    `Double` | `getDouble​(String name, int index)` |
    `Iterable<Double>` | `getDoubles​(String name)` |
    `GeoPoint` | `getGeoPoint​(PropertyPath path)` |
    `GeoPoint` | `getGeoPoint​(String path)` |
    `GeoPoint` | `getGeoPoint​(String name, int index)` |
    `Iterable<GeoPoint>` | `getGeoPoints​(String name)` |
    `Instant` | `getInstant​(PropertyPath path)` |
    `Instant` | `getInstant​(String path)` |
    `Instant` | `getInstant​(String name, int index)` |
    `Iterable<Instant>` | `getInstants​(String name)` |
    `Link` | `getLink​(PropertyPath path)` |
    `Link` | `getLink​(String path)` |
    `Link` | `getLink​(String name, int index)` |
    `Iterable<Link>` | `getLinks​(String name)` |
    `LocalDate` | `getLocalDate​(PropertyPath path)` |
    `LocalDate` | `getLocalDate​(String path)` |
    `LocalDate` | `getLocalDate​(String name, int index)` |
    `Iterable<LocalDate>` | `getLocalDates​(String name)` |
    `LocalDateTime` | `getLocalDateTime​(PropertyPath path)` |
    `LocalDateTime` | `getLocalDateTime​(String path)` |
    `LocalDateTime` | `getLocalDateTime​(String name, int index)` |
    `Iterable<LocalDateTime>` | `getLocalDateTimes​(String name)` |
    `LocalTime` | `getLocalTime​(PropertyPath path)` |
    `LocalTime` | `getLocalTime​(String path)` |
    `LocalTime` | `getLocalTime​(String name, int index)` |
    `Iterable<LocalTime>` | `getLocalTimes​(String name)` |
    `Long` | `getLong​(PropertyPath path)` |
    `Long` | `getLong​(String path)` |
    `Long` | `getLong​(String name, int index)` |
    `Iterable<Long>` | `getLongs​(String name)` |
    `Iterable<Property>` | `getProperties()` |
    `ImmutableList<Property>` | `getProperties​(ValueType valueType)` |
    `ImmutableList<Property>` | `getProperties​(String name)` |
    `Property` | `getProperty​(PropertyPath path)` |
    `Property` | `getProperty​(String path)` |
    `Property` | `getProperty​(String name, int index)` |
    `PropertySet` | `getPropertySet​(PropertyPath path)` |
    `PropertySet` | `getPropertySet​(String path)` |
    `Reference` | `getReference​(PropertyPath path)` |
    `Reference` | `getReference​(String path)` |
    `Reference` | `getReference​(String name, int index)` |
    `Iterable<Reference>` | `getReferences​(String name)` |
    `PropertySet` | `getRoot()` |
    `PropertySet` | `getSet​(PropertyPath path)` |
    `PropertySet` | `getSet​(String path)` |
    `PropertySet` | `getSet​(String name, int index)` |
    `Iterable<PropertySet>` | `getSets​(String name)` |
    `String` | `getString​(PropertyPath path)` |
    `String` | `getString​(String path)` |
    `String` | `getString​(String name, int index)` |
    `Iterable<String>` | `getStrings​(String name)` |
    `int` | `getTotalSize()` |
    `Value` | `getValue​(PropertyPath path)` |
    `Value` | `getValue​(String path)` |
    `Value` | `getValue​(String name, int index)` |
    `Iterable<Value>` | `getValues​(String name)` |
    `int` | `hashCode()` |
    `boolean` | `hasProperty​(PropertyPath path)` |
    `boolean` | `hasProperty​(String path)` |
    `boolean` | `hasProperty​(String name, int index)` |
    `PropertyTree` | `ifNotNull()` |
    `PropertySet` | `newSet()` |
    `PropertySet` | `newSet​(PropertyTree source)` |
    `void` | `removeProperties​(String name)` |
    `void` | `removeProperty​(PropertyPath path)` |
    `void` | `removeProperty​(String path)` |
    `Property` | `setBinaryReference​(PropertyPath path, BinaryReference value)` |
    `Property` | `setBinaryReference​(String name, int index, BinaryReference value)` |
    `Property` | `setBinaryReference​(String path, BinaryReference value)` |
    `Property` | `setBoolean​(PropertyPath path, Boolean value)` |
    `Property` | `setBoolean​(String name, int index, Boolean value)` |
    `Property` | `setBoolean​(String path, Boolean value)` |
    `Property` | `setDouble​(PropertyPath path, Double value)` |
    `Property` | `setDouble​(String name, int index, Double value)` |
    `Property` | `setDouble​(String path, Double value)` |
    `Property` | `setGeoPoint​(PropertyPath path, GeoPoint value)` |
    `Property` | `setGeoPoint​(String name, int index, GeoPoint value)` |
    `Property` | `setGeoPoint​(String path, GeoPoint value)` |
    `Property` | `setInstant​(PropertyPath path, Instant value)` |
    `Property` | `setInstant​(String name, int index, Instant value)` |
    `Property` | `setInstant​(String path, Instant value)` |
    `Property` | `setLink​(PropertyPath path, Link value)` |
    `Property` | `setLink​(String name, int index, Link value)` |
    `Property` | `setLink​(String path, Link value)` |
    `Property` | `setLocalDate​(PropertyPath path, LocalDate value)` |
    `Property` | `setLocalDate​(String name, int index, LocalDate value)` |
    `Property` | `setLocalDate​(String path, LocalDate value)` |
    `Property` | `setLocalDateTime​(PropertyPath path, LocalDateTime value)` |
    `Property` | `setLocalDateTime​(String name, int index, LocalDateTime value)` |
    `Property` | `setLocalDateTime​(String name, int index, LocalTime value)` |
    `Property` | `setLocalDateTime​(String path, LocalDateTime value)` |
    `Property` | `setLocalTime​(PropertyPath path, LocalTime value)` |
    `Property` | `setLocalTime​(String path, LocalTime value)` |
    `Property` | `setLong​(PropertyPath path, Long value)` |
    `Property` | `setLong​(String name, int index, Long value)` |
    `Property` | `setLong​(String path, Long value)` |
    `Property` | `setProperty​(PropertyPath path, Value value)` |
    `Property` | `setProperty​(String name, int index, Value value)` |
    `Property` | `setProperty​(String path, Value value)` |
    `Property` | `setReference​(PropertyPath path, Reference value)` |
    `Property` | `setReference​(String name, int index, Reference value)` |
    `Property` | `setReference​(String path, Reference value)` |
    `Property` | `setSet​(PropertyPath path, PropertySet value)` |
    `Property` | `setSet​(String name, int index, PropertySet value)` |
    `Property` | `setSet​(String path, PropertySet value)` |
    `Property` | `setString​(PropertyPath path, String value)` |
    `Property` | `setString​(String name, int index, String value)` |
    `Property` | `setString​(String path, String value)` |
    `void` | `setValues​(PropertyPath path, Iterable<Value> values)` |
    `void` | `setValues​(String path, Iterable<Value> values)` |
    `Property` | `setXml​(PropertyPath path, String value)` |
    `Property` | `setXml​(String name, int index, String value)` |
    `Property` | `setXml​(String path, String value)` |
    `Map<String,​Object>` | `toMap()` |
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PropertyTree

          public PropertyTree()

      Creates a new PropertyTree using a default PropertyIdProvider which uses UUID.randomUUID().

  - ### Method Detail

    - #### toMap

          public Map<String,​Object> toMap()

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### copy

          public PropertyTree copy()

    - #### getProperties

          public ImmutableList<Property> getProperties​(ValueType valueType)

    - #### ifNotNull

          public PropertyTree ifNotNull()

    - #### newSet

          public PropertySet newSet()

    - #### newSet

          public PropertySet newSet​(PropertyTree source)

    - #### countNames

          public int countNames​(String name)

    - #### addProperty

          public Property addProperty​(String name,
                                      Value value)

    - #### setProperty

          public Property setProperty​(String path,
                                      Value value)

    - #### setProperty

          public Property setProperty​(PropertyPath path,
                                      Value value)

    - #### setProperty

          public Property setProperty​(String name,
                                      int index,
                                      Value value)

    - #### setValues

          public void setValues​(String path,
                                Iterable<Value> values)

    - #### setValues

          public void setValues​(PropertyPath path,
                                Iterable<Value> values)

    - #### removeProperty

          public void removeProperty​(String path)

    - #### removeProperty

          public void removeProperty​(PropertyPath path)

    - #### removeProperties

          public void removeProperties​(String name)

    - #### getRoot

          public PropertySet getRoot()

    - #### hasProperty

          public boolean hasProperty​(String path)

    - #### hasProperty

          public boolean hasProperty​(PropertyPath path)

    - #### hasProperty

          public boolean hasProperty​(String name,
                                     int index)

    - #### getProperty

          public Property getProperty​(String name,
                                      int index)

    - #### getProperty

          public Property getProperty​(PropertyPath path)

    - #### getProperty

          public Property getProperty​(String path)

    - #### getProperties

          public ImmutableList<Property> getProperties​(String name)

    - #### getProperties

          public Iterable<Property> getProperties()

    - #### getValue

          public Value getValue​(String name,
                                int index)

    - #### getValue

          public Value getValue​(PropertyPath path)

    - #### getValue

          public Value getValue​(String path)

    - #### getValues

          public Iterable<Value> getValues​(String name)

    - #### getPropertySet

          public PropertySet getPropertySet​(PropertyPath path)

    - #### getPropertySet

          public PropertySet getPropertySet​(String path)

    - #### getTotalSize

          public int getTotalSize()

    - #### setSet

          public Property setSet​(PropertyPath path,
                                 PropertySet value)

    - #### setSet

          public Property setSet​(String path,
                                 PropertySet value)

    - #### setSet

          public Property setSet​(String name,
                                 int index,
                                 PropertySet value)

    - #### addSet

          public Property addSet​(String name,
                                 PropertySet value)

    - #### addSets

          public Property[] addSets​(String name,
                                    PropertySet... value)

    - #### addSet

          public PropertySet addSet​(String name)

    - #### setString

          public Property setString​(PropertyPath path,
                                    String value)

    - #### setString

          public Property setString​(String path,
                                    String value)

    - #### setString

          public Property setString​(String name,
                                    int index,
                                    String value)

    - #### addString

          public Property addString​(String name,
                                    String value)

    - #### addStrings

          public Property[] addStrings​(String name,
                                       String... value)

    - #### addStrings

          public Property[] addStrings​(String name,
                                       Collection<String> values)

    - #### setXml

          public Property setXml​(PropertyPath path,
                                 String value)

    - #### setXml

          public Property setXml​(String path,
                                 String value)

    - #### setXml

          public Property setXml​(String name,
                                 int index,
                                 String value)

    - #### addXml

          public Property addXml​(String name,
                                 String value)

    - #### addXmls

          public Property[] addXmls​(String name,
                                    String... value)

    - #### setBinaryReference

          public Property setBinaryReference​(PropertyPath path,
                                             BinaryReference value)

    - #### setBinaryReference

          public Property setBinaryReference​(String path,
                                             BinaryReference value)

    - #### setBinaryReference

          public Property setBinaryReference​(String name,
                                             int index,
                                             BinaryReference value)

    - #### addBinaryReference

          public Property addBinaryReference​(String name,
                                             BinaryReference value)

    - #### addBinaryReferences

          public Property[] addBinaryReferences​(String name,
                                                BinaryReference... value)

    - #### setReference

          public Property setReference​(PropertyPath path,
                                       Reference value)

    - #### setReference

          public Property setReference​(String path,
                                       Reference value)

    - #### setReference

          public Property setReference​(String name,
                                       int index,
                                       Reference value)

    - #### addReference

          public Property addReference​(String name,
                                       Reference value)

    - #### addReferences

          public Property[] addReferences​(String name,
                                          Reference... value)

    - #### setLink

          public Property setLink​(PropertyPath path,
                                  Link value)

    - #### setLink

          public Property setLink​(String path,
                                  Link value)

    - #### setLink

          public Property setLink​(String name,
                                  int index,
                                  Link value)

    - #### addLink

          public Property addLink​(String name,
                                  Link value)

    - #### addLinks

          public Property[] addLinks​(String name,
                                     Link... value)

    - #### setBoolean

          public Property setBoolean​(PropertyPath path,
                                     Boolean value)

    - #### setBoolean

          public Property setBoolean​(String path,
                                     Boolean value)

    - #### setBoolean

          public Property setBoolean​(String name,
                                     int index,
                                     Boolean value)

    - #### addBoolean

          public Property addBoolean​(String name,
                                     Boolean value)

    - #### addBooleans

          public Property[] addBooleans​(String name,
                                        Boolean... value)

    - #### setLong

          public Property setLong​(PropertyPath path,
                                  Long value)

    - #### setLong

          public Property setLong​(String path,
                                  Long value)

    - #### setLong

          public Property setLong​(String name,
                                  int index,
                                  Long value)

    - #### addLong

          public Property addLong​(String name,
                                  Long value)

    - #### addLongs

          public Property[] addLongs​(String name,
                                     Long... value)

    - #### setDouble

          public Property setDouble​(PropertyPath path,
                                    Double value)

    - #### setDouble

          public Property setDouble​(String path,
                                    Double value)

    - #### setDouble

          public Property setDouble​(String name,
                                    int index,
                                    Double value)

    - #### addDouble

          public Property addDouble​(String name,
                                    Double value)

    - #### addDoubles

          public Property[] addDoubles​(String name,
                                       Double... value)

    - #### setGeoPoint

          public Property setGeoPoint​(PropertyPath path,
                                      GeoPoint value)

    - #### setGeoPoint

          public Property setGeoPoint​(String path,
                                      GeoPoint value)

    - #### setGeoPoint

          public Property setGeoPoint​(String name,
                                      int index,
                                      GeoPoint value)

    - #### addGeoPoint

          public Property addGeoPoint​(String name,
                                      GeoPoint value)

    - #### addGeoPoints

          public Property[] addGeoPoints​(String name,
                                         GeoPoint... value)

    - #### setLocalDate

          public Property setLocalDate​(PropertyPath path,
                                       LocalDate value)

    - #### setLocalDate

          public Property setLocalDate​(String path,
                                       LocalDate value)

    - #### setLocalDate

          public Property setLocalDate​(String name,
                                       int index,
                                       LocalDate value)

    - #### addLocalDate

          public Property addLocalDate​(String name,
                                       LocalDate value)

    - #### addLocalDates

          public Property[] addLocalDates​(String name,
                                          LocalDate... value)

    - #### setLocalDateTime

          public Property setLocalDateTime​(PropertyPath path,
                                           LocalDateTime value)

    - #### setLocalDateTime

          public Property setLocalDateTime​(String path,
                                           LocalDateTime value)

    - #### setLocalDateTime

          public Property setLocalDateTime​(String name,
                                           int index,
                                           LocalDateTime value)

    - #### addLocalDateTime

          public Property addLocalDateTime​(String name,
                                           LocalDateTime value)

    - #### addLocalDateTimes

          public Property[] addLocalDateTimes​(String name,
                                              LocalDateTime... value)

    - #### setLocalTime

          public Property setLocalTime​(PropertyPath path,
                                       LocalTime value)

    - #### setLocalTime

          public Property setLocalTime​(String path,
                                       LocalTime value)

    - #### setLocalDateTime

          public Property setLocalDateTime​(String name,
                                           int index,
                                           LocalTime value)

    - #### addLocalTime

          public Property addLocalTime​(String name,
                                       LocalTime value)

    - #### addLocalTimes

          public Property[] addLocalTimes​(String name,
                                          LocalTime... value)

    - #### setInstant

          public Property setInstant​(PropertyPath path,
                                     Instant value)

    - #### setInstant

          public Property setInstant​(String path,
                                     Instant value)

    - #### setInstant

          public Property setInstant​(String name,
                                     int index,
                                     Instant value)

    - #### addInstant

          public Property addInstant​(String name,
                                     Instant value)

    - #### addInstants

          public Property[] addInstants​(String name,
                                        Instant... value)

    - #### getSet

          public PropertySet getSet​(String name,
                                    int index)

    - #### getSet

          public PropertySet getSet​(PropertyPath path)

    - #### getSet

          public PropertySet getSet​(String path)

    - #### getSets

          public Iterable<PropertySet> getSets​(String name)

    - #### getString

          public String getString​(String name,
                                  int index)

    - #### getString

          public String getString​(PropertyPath path)

    - #### getString

          public String getString​(String path)

    - #### getStrings

          public Iterable<String> getStrings​(String name)

    - #### getBoolean

          public Boolean getBoolean​(String name,
                                    int index)

    - #### getBoolean

          public Boolean getBoolean​(PropertyPath path)

    - #### getBoolean

          public Boolean getBoolean​(String path)

    - #### getBooleans

          public Iterable<Boolean> getBooleans​(String name)

    - #### getLong

          public Long getLong​(String name,
                              int index)

    - #### getLong

          public Long getLong​(PropertyPath path)

    - #### getLong

          public Long getLong​(String path)

    - #### getLongs

          public Iterable<Long> getLongs​(String name)

    - #### getDouble

          public Double getDouble​(String name,
                                  int index)

    - #### getDouble

          public Double getDouble​(PropertyPath path)

    - #### getDouble

          public Double getDouble​(String path)

    - #### getDoubles

          public Iterable<Double> getDoubles​(String name)

    - #### getGeoPoint

          public GeoPoint getGeoPoint​(String name,
                                      int index)

    - #### getGeoPoint

          public GeoPoint getGeoPoint​(PropertyPath path)

    - #### getGeoPoint

          public GeoPoint getGeoPoint​(String path)

    - #### getGeoPoints

          public Iterable<GeoPoint> getGeoPoints​(String name)

    - #### getBinaryReference

          public BinaryReference getBinaryReference​(String name,
                                                    int index)

    - #### getBinaryReference

          public BinaryReference getBinaryReference​(PropertyPath path)

    - #### getBinaryReference

          public BinaryReference getBinaryReference​(String path)

    - #### getBinaryReferences

          public Iterable<BinaryReference> getBinaryReferences​(String name)

    - #### getLink

          public Link getLink​(String name,
                              int index)

    - #### getLink

          public Link getLink​(PropertyPath path)

    - #### getLink

          public Link getLink​(String path)

    - #### getLinks

          public Iterable<Link> getLinks​(String name)

    - #### getReference

          public Reference getReference​(String name,
                                        int index)

    - #### getReference

          public Reference getReference​(PropertyPath path)

    - #### getReference

          public Reference getReference​(String path)

    - #### getReferences

          public Iterable<Reference> getReferences​(String name)

    - #### getLocalDate

          public LocalDate getLocalDate​(String name,
                                        int index)

    - #### getLocalDate

          public LocalDate getLocalDate​(PropertyPath path)

    - #### getLocalDate

          public LocalDate getLocalDate​(String path)

    - #### getLocalDates

          public Iterable<LocalDate> getLocalDates​(String name)

    - #### getLocalDateTime

          public LocalDateTime getLocalDateTime​(String name,
                                                int index)

    - #### getLocalDateTime

          public LocalDateTime getLocalDateTime​(PropertyPath path)

    - #### getLocalDateTime

          public LocalDateTime getLocalDateTime​(String path)

    - #### getLocalDateTimes

          public Iterable<LocalDateTime> getLocalDateTimes​(String name)

    - #### getLocalTime

          public LocalTime getLocalTime​(String name,
                                        int index)

    - #### getLocalTime

          public LocalTime getLocalTime​(PropertyPath path)

    - #### getLocalTime

          public LocalTime getLocalTime​(String path)

    - #### getLocalTimes

          public Iterable<LocalTime> getLocalTimes​(String name)

    - #### getInstant

          public Instant getInstant​(String name,
                                    int index)

    - #### getInstant

          public Instant getInstant​(PropertyPath path)

    - #### getInstant

          public Instant getInstant​(String path)

    - #### getInstants

          public Iterable<Instant> getInstants​(String name)