Package org.apache.sling.discovery.commons.providers

# Class DefaultInstanceDescription

java.lang.Object
org.apache.sling.discovery.commons.providers.DefaultInstanceDescription

All Implemented Interfaces:
  `org.apache.sling.discovery.InstanceDescription`

Direct Known Subclasses:
  `NonLocalInstanceDescription`

public class DefaultInstanceDescription extends Object implements org.apache.sling.discovery.InstanceDescription
Base implementation for the InstanceDescription interface.

Allows creation of the object with clusterview and/or properties null - to be set later but before usage!

## Field Summary

### Fields inherited from interface org.apache.sling.discovery.InstanceDescription

`PROPERTY_DESCRIPTION, PROPERTY_ENDPOINTS, PROPERTY_NAME`

## Constructor Summary

Constructors
Constructor
Description
`DefaultInstanceDescription(DefaultClusterView clusterView, boolean isLeader, boolean isOwn, String slingId, Map<String,String> properties)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`org.apache.sling.discovery.ClusterView`
`getClusterView()`
`Map<String,String>`
`getProperties()`
`String`
`getProperty(String name)`
`String`
`getSlingId()`
`int`
`hashCode()`
`boolean`
`isLeader()`
`boolean`
`isLocal()`
`protected void`
`setProperties(Map<String,String> properties)`
Sets the properties of this instance
`void`
`setProperty(String key, String value)`
for testing only!
`String`
`toString()`

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

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

## Constructor Details

### DefaultInstanceDescription

public DefaultInstanceDescription(DefaultClusterView clusterView, boolean isLeader, boolean isOwn, String slingId, Map<String,String> properties)

## Method Details

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### getClusterView

public org.apache.sling.discovery.ClusterView getClusterView()

Specified by:
  `getClusterView` in interface `org.apache.sling.discovery.InstanceDescription`

### isLeader

public boolean isLeader()

Specified by:
  `isLeader` in interface `org.apache.sling.discovery.InstanceDescription`

### isLocal

public boolean isLocal()

Specified by:
  `isLocal` in interface `org.apache.sling.discovery.InstanceDescription`

### getSlingId

public String getSlingId()

Specified by:
  `getSlingId` in interface `org.apache.sling.discovery.InstanceDescription`

### getProperty

public String getProperty(String name)

Specified by:
  `getProperty` in interface `org.apache.sling.discovery.InstanceDescription`

### getProperties

public Map<String,String> getProperties()

Specified by:
  `getProperties` in interface `org.apache.sling.discovery.InstanceDescription`

### setProperties

protected void setProperties(Map<String,String> properties)
Sets the properties of this instance

Parameters:
  `properties` -

### setProperty

public void setProperty(String key, String value)
for testing only!