public class Record extends Object
Constructor and Description |
---|
Record()
Creates a new
Record . |
Record(JsonObject json)
Creates a new
Record from its json representation. |
Record(Record other)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Checks whether or not the current object is equal to the given object.
|
JsonObject |
getLocation() |
JsonObject |
getMetadata()
Gets the metadata attached to the record.
|
String |
getName()
Gets the name of the service.
|
String |
getRegistration()
Gets the registration id if any.
|
Status |
getStatus()
Gets the current status of the service.
|
String |
getType()
Gets the service type.
|
int |
hashCode() |
boolean |
match(JsonObject filter)
Checks whether or not the current
Record matches the filter. |
Record |
setLocation(JsonObject location)
Sets the json object describing the location of the service.
|
Record |
setMetadata(JsonObject metadata) |
Record |
setName(String name)
Sets the name of the service.
|
Record |
setRegistration(String reg)
Sets the registration id.
|
Record |
setStatus(Status status)
Sets the status of the service.
|
Record |
setType(String type)
Sets the type of service.
|
JsonObject |
toJson() |
String |
toString() |
public static final String ENDPOINT
public Record()
Record
.public Record(JsonObject json)
Record
from its json representation.json
- the json objectpublic Record(Record other)
other
- the record to copypublic JsonObject toJson()
Record
.public JsonObject getLocation()
ENDPOINT
entry.public Record setLocation(JsonObject location)
ENDPOINT
entry.location
- the locationRecord
public JsonObject getMetadata()
null
.public Record setMetadata(JsonObject metadata)
public String getName()
public Record setName(String name)
name
- the nameRecord
public Status getStatus()
public Record setStatus(Status status)
Status.UP
. When withdrawn, the
status is set to Status.DOWN
.status
- the status, must not be null
Record
public Record setRegistration(String reg)
reg
- the registration idRecord
public String getRegistration()
null
result means that the record has not been published.public String getType()
The type defines how the the service object is retrieved, and also manages the binding. Some records may have no type and let the consumer manage how the service is used.
public Record setType(String type)
type
- the typeRecord
public boolean match(JsonObject filter)
Record
matches the filter.filter
- the filterpublic boolean equals(Object o)
public int hashCode()
Copyright © 2021 Eclipse. All rights reserved.