/** * Returns an instance of {@code BlockNamespace}. * * @param namespace the namespace to be blocked. * @param dittoHeaders the headers of the command. * @return the instance. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code namespace} is empty. */ public static BlockNamespace of(final CharSequence namespace, final DittoHeaders dittoHeaders) { return new BlockNamespace(namespace, dittoHeaders); }
/** * Same as get {@link #getNamespace()}. */ @Override public String getId() { return getNamespace(); }
/** * Returns an instance of {@code UnblockNamespace}. * * @param namespace the namespace to be unblocked. * @param dittoHeaders the headers of the command. * @return the instance. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code namespace} is empty. */ public static UnblockNamespace of(final CharSequence namespace, final DittoHeaders dittoHeaders) { return new UnblockNamespace(namespace, dittoHeaders); }
private static void addNamespacesStrategies(final MappingStrategiesBuilder builder) { builder.add(NamespaceCommandRegistry.getInstance()); builder.add(NamespaceCommandResponseRegistry.getInstance()); builder.add(NamespaceErrorRegistry.getInstance()); }
@Override public UnblockNamespaceResponse setDittoHeaders(final DittoHeaders dittoHeaders) { return new UnblockNamespaceResponse(getNamespace(), getResourceType(), dittoHeaders); }
@Override public BlockNamespaceResponse setDittoHeaders(final DittoHeaders dittoHeaders) { return new BlockNamespaceResponse(getNamespace(), getResourceType(), dittoHeaders); }
@Override public UnblockNamespace setDittoHeaders(final DittoHeaders dittoHeaders) { return new UnblockNamespace(getNamespace(), dittoHeaders); }
@Override public BlockNamespace setDittoHeaders(final DittoHeaders dittoHeaders) { return new BlockNamespace(getNamespace(), dittoHeaders); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } final PurgeNamespaceResponse that = (PurgeNamespaceResponse) o; return that.canEqual(this) && successful == that.successful && super.equals(that); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> predicate) { super.appendPayload(jsonObjectBuilder, schemaVersion, predicate); jsonObjectBuilder.set(JsonFields.SUCCESSFUL, isSuccessful(), schemaVersion.and(predicate)); }
/** * Returns an instance of {@code PurgeNamespaceResponse} which indicates that a namespace purge failed. * * @param namespace the namespace the returned response relates to. * @param resourceType type of the {@code Resource} represented by the returned response. * @param dittoHeaders the headers of the command which caused the returned response. * @return a response for a failed namespace purge. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code namespace} or {@code resourceType} is empty. */ public static PurgeNamespaceResponse failed(final CharSequence namespace, final CharSequence resourceType, final DittoHeaders dittoHeaders) { return new PurgeNamespaceResponse(namespace, resourceType, false, dittoHeaders); }
/** * Same as {@link #getNamespace()}. */ @Override public String getId() { return getNamespace(); }
/** * Returns an instance of {@code PurgeNamespace}. * * @param namespace the namespace to be purged. * @param dittoHeaders the headers of the command. * @return the instance. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code namespace} is empty. */ public static PurgeNamespace of(final CharSequence namespace, final DittoHeaders dittoHeaders) { return new PurgeNamespace(namespace, dittoHeaders); }
/** * Returns an instance of {@code UnblockNamespaceResponse}. * * @param namespace the namespace the returned response relates to. * @param resourceType type of the {@code Resource} represented by the returned response. * @param dittoHeaders the headers of the command which caused the returned response. * @return the instance. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code namespace} or {@code resourceType} is empty. */ public static UnblockNamespaceResponse getInstance(final CharSequence namespace, final CharSequence resourceType, final DittoHeaders dittoHeaders) { return new UnblockNamespaceResponse(namespace, resourceType, dittoHeaders); }
/** * Returns an instance of {@code BlockNamespaceResponse}. * * @param namespace the namespace the returned response relates to. * @param resourceType type of the {@code Resource} represented by the returned response. * @param dittoHeaders the headers of the command which caused the returned response. * @return the instance. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code namespace} or {@code resourceType} is empty. */ public static BlockNamespaceResponse getInstance(final CharSequence namespace, final CharSequence resourceType, final DittoHeaders dittoHeaders) { return new BlockNamespaceResponse(namespace, resourceType, dittoHeaders); }
private static void addNamespacesStrategies(final MappingStrategiesBuilder builder) { builder.add(NamespaceCommandRegistry.getInstance()); builder.add(NamespaceCommandResponseRegistry.getInstance()); builder.add(NamespaceErrorRegistry.getInstance()); }
/** * Returns an instance of {@code PurgeNamespaceResponse} which indicates a successful namespace purge. * * @param namespace the namespace the returned response relates to. * @param resourceType type of the {@code Resource} represented by the returned response. * @param dittoHeaders the headers of the command which caused the returned response. * @return a response for a successful namespace purge. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code namespace} or {@code resourceType} is empty. */ public static PurgeNamespaceResponse successful(final CharSequence namespace, final CharSequence resourceType, final DittoHeaders dittoHeaders) { return new PurgeNamespaceResponse(namespace, resourceType, true, dittoHeaders); }
private static void addNamespacesStrategies(final MappingStrategiesBuilder builder) { builder.add(NamespaceCommandRegistry.getInstance()); builder.add(NamespaceCommandResponseRegistry.getInstance()); builder.add(NamespaceErrorRegistry.getInstance()); }
private static void addNamespacesStrategies(final MappingStrategiesBuilder builder) { builder.add(NamespaceCommandRegistry.getInstance()); builder.add(NamespaceCommandResponseRegistry.getInstance()); builder.add(NamespaceErrorRegistry.getInstance()); }
private static void addNamespacesStrategies(final MappingStrategiesBuilder builder) { builder.add(NamespaceCommandRegistry.getInstance()); builder.add(NamespaceCommandResponseRegistry.getInstance()); builder.add(NamespaceErrorRegistry.getInstance()); }