Package org.apache.solr.common.cloud

# Class ZkNodeProps

java.lang.Object
org.apache.solr.common.cloud.ZkNodeProps

All Implemented Interfaces:
  `MapSerializable`, `MapWriter`, `NavigableObject`, `org.noggit.JSONWriter.Writable`

Direct Known Subclasses:
  `DocCollection`, `Replica`, `RoutingRule`, `Slice`

public class ZkNodeProps extends Object implements MapWriter
ZkNodeProps contains generic immutable properties.

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter

`MapWriter.EntryWriter`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final Map<String,Object>`
`propMap`

### Fields inherited from interface org.apache.solr.common.MapWriter

`EMPTY`

## Constructor Summary

Constructors
Constructor
Description
`ZkNodeProps(String... keyVals)`
Constructor that populates from an array of Strings in form key1, value1, key2, value2, ..., keyN, valueN
`ZkNodeProps(Map<String,Object> propMap)`
Construct ZKNodeProps from map.
`ZkNodeProps(MapWriter mw)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`containsKey(String key)`
Check if property key exists.
`boolean`
`equals(Object that)`
`Object`
`get(String key)`
`boolean`
`getBool(String key, boolean b)`
`Integer`
`getInt(String key, Integer def)`
Get a string property value.
`Map<String,Object>`
`getProperties()`
Get all properties as map.
`String`
`getStr(String key)`
Get a string property value.
`String`
`getStr(String key, String def)`
Get a string property value.
`int`
`hashCode()`
`Set<String>`
`keySet()`
Get property keys.
`static ZkNodeProps`
`load(byte[] bytes)`
Create Replica from json string that is typically stored in zookeeper.
`ZkNodeProps`
`plus(String key, Object val)`
`ZkNodeProps`
`plus(Map<String,Object> newVals)`
`Map<String,Object>`
`shallowCopy()`
Returns a shallow writable copy of the properties
`String`
`toString()`
`void`
`writeMap(MapWriter.EntryWriter ew)`
Writes this object's entries out to `ew`.

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

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

### Methods inherited from interface org.apache.solr.common.MapWriter

`jsonStr, toMap, write`

### Methods inherited from interface org.apache.solr.common.NavigableObject

`_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size`

## Field Details

### propMap

protected final Map<String,Object> propMap

## Constructor Details

### ZkNodeProps

public ZkNodeProps(Map<String,Object> propMap)
Construct ZKNodeProps from map.

### ZkNodeProps

public ZkNodeProps(MapWriter mw)

### ZkNodeProps

public ZkNodeProps(String... keyVals)
Constructor that populates from an array of Strings in form key1, value1, key2, value2, ..., keyN, valueN

## Method Details

### plus

public ZkNodeProps plus(String key, Object val)

### plus

public ZkNodeProps plus(Map<String,Object> newVals)

### keySet

public Set<String> keySet()
Get property keys.

### getProperties

public Map<String,Object> getProperties()
Get all properties as map.

### shallowCopy

public Map<String,Object> shallowCopy()
Returns a shallow writable copy of the properties

### load

public static ZkNodeProps load(byte[] bytes)
Create Replica from json string that is typically stored in zookeeper.

### getStr

public String getStr(String key)
Get a string property value.

### getInt

public Integer getInt(String key, Integer def)
Get a string property value.

### getStr

public String getStr(String key, String def)
Get a string property value.

### get

public Object get(String key)

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### containsKey

public boolean containsKey(String key)
Check if property key exists.

### getBool

public boolean getBool(String key, boolean b)

### writeMap

public void writeMap(MapWriter.EntryWriter ew) throws IOException
Description copied from interface: `MapWriter`
Writes this object's entries out to `ew`.

Specified by:
  `writeMap` in interface `MapWriter`
Throws:
  `IOException`

### equals

public boolean equals(Object that)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`