io.vertx.rxjava3.amqp.AmqpMessage Maven / Gradle / Ivy
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.rxjava3.amqp;
import io.vertx.rxjava3.RxHelper;
import io.vertx.rxjava3.ObservableHelper;
import io.vertx.rxjava3.FlowableHelper;
import io.vertx.rxjava3.impl.AsyncResultMaybe;
import io.vertx.rxjava3.impl.AsyncResultSingle;
import io.vertx.rxjava3.impl.AsyncResultCompletable;
import io.vertx.rxjava3.WriteStreamObserver;
import io.vertx.rxjava3.WriteStreamSubscriber;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;
/**
* Represents an AMQP message.
*
* Reference about the different metadata can be found on
* AMQP message properties.
*
* Note that the body is retrieved using body*
method depending on the expected type.
*
*
* NOTE: This class has been automatically generated from the {@link io.vertx.amqp.AmqpMessage original} non RX-ified interface using Vert.x codegen.
*/
@RxGen(io.vertx.amqp.AmqpMessage.class)
public class AmqpMessage {
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AmqpMessage that = (AmqpMessage) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final TypeArg __TYPE_ARG = new TypeArg<>( obj -> new AmqpMessage((io.vertx.amqp.AmqpMessage) obj),
AmqpMessage::getDelegate
);
private final io.vertx.amqp.AmqpMessage delegate;
public AmqpMessage(io.vertx.amqp.AmqpMessage delegate) {
this.delegate = delegate;
}
public AmqpMessage(Object delegate) {
this.delegate = (io.vertx.amqp.AmqpMessage)delegate;
}
public io.vertx.amqp.AmqpMessage getDelegate() {
return delegate;
}
/**
* @return a builder to create an {@link io.vertx.rxjava3.amqp.AmqpMessage}.
*/
public static io.vertx.rxjava3.amqp.AmqpMessageBuilder create() {
io.vertx.rxjava3.amqp.AmqpMessageBuilder ret = io.vertx.rxjava3.amqp.AmqpMessageBuilder.newInstance((io.vertx.amqp.AmqpMessageBuilder)io.vertx.amqp.AmqpMessage.create());
return ret;
}
/**
* Creates a builder to create a new {@link io.vertx.rxjava3.amqp.AmqpMessage} copying the metadata from the passed message.
* @param existing an existing message, must not be null
.
* @return a builder to create an {@link io.vertx.rxjava3.amqp.AmqpMessage}.
*/
public static io.vertx.rxjava3.amqp.AmqpMessageBuilder create(io.vertx.rxjava3.amqp.AmqpMessage existing) {
io.vertx.rxjava3.amqp.AmqpMessageBuilder ret = io.vertx.rxjava3.amqp.AmqpMessageBuilder.newInstance((io.vertx.amqp.AmqpMessageBuilder)io.vertx.amqp.AmqpMessage.create(existing.getDelegate()));
return ret;
}
/**
* @return whether or not the message is durable.
*/
public boolean isDurable() {
boolean ret = delegate.isDurable();
return ret;
}
/**
* @return if true
, then this message has not been acquired by any other link. If false
, then this message MAY have previously been acquired by another link or links.
*/
public boolean isFirstAcquirer() {
boolean ret = delegate.isFirstAcquirer();
return ret;
}
/**
* @return the relative message priority. Higher numbers indicate higher priority messages. Messages with higher priorities MAY be delivered before those with lower priorities.
*/
public int priority() {
int ret = delegate.priority();
return ret;
}
/**
* @return the number of unsuccessful previous attempts to deliver this message. If this value is non-zero it can be taken as an indication that the delivery might be a duplicate. On first delivery, the value is zero. It is incremented upon an outcome being settled at the sender, according to rules defined for each outcome.
*/
public int deliveryCount() {
int ret = delegate.deliveryCount();
return ret;
}
/**
* @return the duration in milliseconds for which the message is to be considered "live".
*/
public long ttl() {
long ret = delegate.ttl();
return ret;
}
/**
* @return the message id
*/
public java.lang.String id() {
java.lang.String ret = delegate.id();
return ret;
}
/**
* @return the message address, also named to
field
*/
public java.lang.String address() {
java.lang.String ret = delegate.address();
return ret;
}
/**
* @return The address of the node to send replies to, if any.
*/
public java.lang.String replyTo() {
java.lang.String ret = delegate.replyTo();
return ret;
}
/**
* @return The client-specific id that can be used to mark or identify messages between clients.
*/
public java.lang.String correlationId() {
java.lang.String ret = delegate.correlationId();
return ret;
}
/**
* @return whether the body is null
. This method returns true
is the message does not contain a body or if the message contain a null
AMQP value as body.
*/
public boolean isBodyNull() {
boolean ret = delegate.isBodyNull();
return ret;
}
/**
* @return the boolean value contained in the body. The value must be passed as AMQP value.
*/
public boolean bodyAsBoolean() {
boolean ret = delegate.bodyAsBoolean();
return ret;
}
/**
* @return the byte value contained in the body. The value must be passed as AMQP value.
*/
public byte bodyAsByte() {
byte ret = delegate.bodyAsByte();
return ret;
}
/**
* @return the short value contained in the body. The value must be passed as AMQP value.
*/
public short bodyAsShort() {
short ret = delegate.bodyAsShort();
return ret;
}
/**
* @return the integer value contained in the body. The value must be passed as AMQP value.
*/
public int bodyAsInteger() {
int ret = delegate.bodyAsInteger();
return ret;
}
/**
* @return the long value contained in the body. The value must be passed as AMQP value.
*/
public long bodyAsLong() {
long ret = delegate.bodyAsLong();
return ret;
}
/**
* @return the float value contained in the body. The value must be passed as AMQP value.
*/
public float bodyAsFloat() {
float ret = delegate.bodyAsFloat();
return ret;
}
/**
* @return the double value contained in the body. The value must be passed as AMQP value.
*/
public double bodyAsDouble() {
double ret = delegate.bodyAsDouble();
return ret;
}
/**
* @return the character value contained in the body. The value must be passed as AMQP value.
*/
public char bodyAsChar() {
char ret = delegate.bodyAsChar();
return ret;
}
/**
* @return the bytes contained in the body. The value must be passed as AMQP data.
*/
public io.vertx.rxjava3.core.buffer.Buffer bodyAsBinary() {
io.vertx.rxjava3.core.buffer.Buffer ret = io.vertx.rxjava3.core.buffer.Buffer.newInstance((io.vertx.core.buffer.Buffer)delegate.bodyAsBinary());
return ret;
}
/**
* @return the string value contained in the body. The value must be passed as AMQP value.
*/
public java.lang.String bodyAsString() {
java.lang.String ret = delegate.bodyAsString();
return ret;
}
/**
* @return the symbol value contained in the body. The value must be passed as AMQP value.
*/
public java.lang.String bodyAsSymbol() {
java.lang.String ret = delegate.bodyAsSymbol();
return ret;
}
/**
* @return the list of values contained in the body. The value must be passed as AMQP value.
*/
public java.util.List bodyAsList() {
java.util.List ret = delegate.bodyAsList();
return ret;
}
/**
* @return the JSON object contained in the body. The value must be passed as AMQP data.
*/
public io.vertx.core.json.JsonObject bodyAsJsonObject() {
io.vertx.core.json.JsonObject ret = delegate.bodyAsJsonObject();
return ret;
}
/**
* @return the JSON array contained in the body. The value must be passed as AMQP data.
*/
public io.vertx.core.json.JsonArray bodyAsJsonArray() {
io.vertx.core.json.JsonArray ret = delegate.bodyAsJsonArray();
return ret;
}
public java.lang.String subject() {
java.lang.String ret = delegate.subject();
return ret;
}
public java.lang.String contentType() {
java.lang.String ret = delegate.contentType();
return ret;
}
public java.lang.String contentEncoding() {
java.lang.String ret = delegate.contentEncoding();
return ret;
}
public long expiryTime() {
long ret = delegate.expiryTime();
return ret;
}
public long creationTime() {
long ret = delegate.creationTime();
return ret;
}
public java.lang.String groupId() {
java.lang.String ret = delegate.groupId();
return ret;
}
public java.lang.String replyToGroupId() {
java.lang.String ret = delegate.replyToGroupId();
return ret;
}
public long groupSequence() {
long ret = delegate.groupSequence();
return ret;
}
/**
* @return the message properties as JSON object.
*/
public io.vertx.core.json.JsonObject applicationProperties() {
io.vertx.core.json.JsonObject ret = delegate.applicationProperties();
return ret;
}
/**
* When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
* the incoming message. It marks the message as delivered with the accepted
status.
* @return the current {@link io.vertx.rxjava3.amqp.AmqpMessage} object
*/
public io.vertx.rxjava3.amqp.AmqpMessage accepted() {
delegate.accepted();
return this;
}
/**
* When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
* the incoming message as rejected
.
* @return the current {@link io.vertx.rxjava3.amqp.AmqpMessage} object
*/
public io.vertx.rxjava3.amqp.AmqpMessage rejected() {
delegate.rejected();
return this;
}
/**
* When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
* the incoming message as released
.
* @return the current {@link io.vertx.rxjava3.amqp.AmqpMessage} object
*/
public io.vertx.rxjava3.amqp.AmqpMessage released() {
delegate.released();
return this;
}
/**
* When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
* the incoming message as modified
.
* @param deliveryFailed pass true
to increase the failed delivery count
* @param undeliverableHere pass true
to prevent re-delivery of this message to the same consumer
* @return the current {@link io.vertx.rxjava3.amqp.AmqpMessage} object
*/
public io.vertx.rxjava3.amqp.AmqpMessage modified(boolean deliveryFailed, boolean undeliverableHere) {
delegate.modified(deliveryFailed, undeliverableHere);
return this;
}
/**
* @return the timestamp value contained in the body. The value must be passed as AMQP value.
*/
public java.time.Instant bodyAsTimestamp() {
java.time.Instant ret = delegate.bodyAsTimestamp();
return ret;
}
/**
* @return the UUID value contained in the body. The value must be passed as AMQP value.
*/
public java.util.UUID bodyAsUUID() {
java.util.UUID ret = delegate.bodyAsUUID();
return ret;
}
public static AmqpMessage newInstance(io.vertx.amqp.AmqpMessage arg) {
return arg != null ? new AmqpMessage(arg) : null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy