@Immutable public final class PolicyIdCreated extends AbstractThingEvent<PolicyIdCreated> implements ThingModifiedEvent<PolicyIdCreated>
policyId was created (e.g. before it was in v1 with ACL, so setting
a Policy ID will create the Policy ID).ThingEvent.JsonFieldsorg.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<T>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,T>| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
Name of this event.
|
static String |
TYPE
Type of this event.
|
RESOURCE_TYPE, TYPE_PREFIX| Modifier and Type | Method and Description |
|---|---|
protected void |
appendPayloadAndBuild(org.eclipse.ditto.json.JsonObjectBuilder jsonObjectBuilder,
org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion,
Predicate<org.eclipse.ditto.json.JsonField> predicate)
Appends the event specific custom payload to the passed
jsonObjectBuilder. |
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
static PolicyIdCreated |
fromJson(org.eclipse.ditto.json.JsonObject jsonObject,
org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
Creates a new
PolicyIdCreated from a JSON object. |
static PolicyIdCreated |
fromJson(String jsonString,
org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
Creates a new
PolicyIdCreated from a JSON string. |
Optional<org.eclipse.ditto.json.JsonValue> |
getEntity(org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion) |
String |
getPolicyId()
Returns the created Policy ID.
|
org.eclipse.ditto.json.JsonPointer |
getResourcePath() |
int |
hashCode() |
static PolicyIdCreated |
of(String thingId,
String policyId,
long revision,
org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
Creates a new
PolicyIdCreated object. |
static PolicyIdCreated |
of(String thingId,
String policyId,
long revision,
Instant timestamp,
org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
Creates a new
PolicyIdCreated object. |
PolicyIdCreated |
setDittoHeaders(org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders) |
PolicyIdCreated |
setRevision(long revision) |
String |
toString() |
getDittoHeaders, getManifest, getRevision, getThingId, getTimestamp, getType, toJsonclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetId, getResourceType, getThingIdgetImplementedSchemaVersion, getRevision, getTimestamp, getType, toJsontoJson, toJson, toJsonString, toJsonStringgetLatestSchemaVersion, getSupportedSchemaVersions, implementsSchemaVersion, implementsSchemaVersion, toJsonStringpublic static final String NAME
public static final String TYPE
public static PolicyIdCreated of(String thingId, String policyId, long revision, org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
PolicyIdCreated object.thingId - the ID of the Thing with which this event is associated.policyId - the ID of the Policy.revision - the revision of the Thing.dittoHeaders - the headers of the command which was the cause of this event.PolicyIdCreatedNullPointerException - if thingId, revision or dittoHeaders are null.public static PolicyIdCreated of(String thingId, String policyId, long revision, @Nullable Instant timestamp, org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
PolicyIdCreated object.thingId - the ID of the Thing with which this event is associated.policyId - the ID of the Policy.revision - the revision of the Thing.timestamp - the timestamp of this event.dittoHeaders - the headers of the command which was the cause of this event.PolicyIdCreatedNullPointerException - if thingId, revision or dittoHeaders are null.public static PolicyIdCreated fromJson(String jsonString, org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
PolicyIdCreated from a JSON string.jsonString - the JSON string of which a new PolicyIdCreated instance is to be created.dittoHeaders - the headers of the command which was the cause of this event.PolicyIdCreated which was created from the given JSON string.NullPointerException - if jsonString is null.IllegalArgumentException - if jsonString is empty.org.eclipse.ditto.json.JsonParseException - if the passed in jsonString was not in the expected
'PolicyIdCreated' format.public static PolicyIdCreated fromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
PolicyIdCreated from a JSON object.jsonObject - the JSON object from which a new PolicyIdCreated instance is to be created.dittoHeaders - the headers of the command which was the cause of this event.PolicyIdCreated which was created from the given JSON object.NullPointerException - if jsonObject is null.org.eclipse.ditto.json.JsonParseException - if the passed in jsonObject was not in the expected
'PolicyIdCreated' format.public String getPolicyId()
public Optional<org.eclipse.ditto.json.JsonValue> getEntity(org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion)
getEntity in interface org.eclipse.ditto.signals.base.WithOptionalEntitypublic org.eclipse.ditto.json.JsonPointer getResourcePath()
getResourcePath in interface org.eclipse.ditto.signals.base.WithResourcepublic PolicyIdCreated setRevision(long revision)
setRevision in interface org.eclipse.ditto.signals.events.base.Event<PolicyIdCreated>public PolicyIdCreated setDittoHeaders(org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
setDittoHeaders in interface org.eclipse.ditto.model.base.headers.WithDittoHeaders<PolicyIdCreated>setDittoHeaders in interface ThingEvent<PolicyIdCreated>setDittoHeaders in interface ThingModifiedEvent<PolicyIdCreated>protected void appendPayloadAndBuild(org.eclipse.ditto.json.JsonObjectBuilder jsonObjectBuilder,
org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion,
Predicate<org.eclipse.ditto.json.JsonField> predicate)
AbstractThingEventjsonObjectBuilder.appendPayloadAndBuild in class AbstractThingEvent<PolicyIdCreated>jsonObjectBuilder - the JsonObjectBuilder to add the custom payload to.schemaVersion - the JsonSchemaVersion used in toJson().predicate - the predicate to evaluate when adding the payload.public int hashCode()
hashCode in class AbstractThingEvent<PolicyIdCreated>public boolean equals(@Nullable Object o)
equals in class AbstractThingEvent<PolicyIdCreated>protected boolean canEqual(Object other)
canEqual in class AbstractThingEvent<PolicyIdCreated>public String toString()
toString in class AbstractThingEvent<PolicyIdCreated>Copyright © 2017–2019 Eclipse Foundation. All rights reserved.