blob: d607d8c1831201bad6931e537876707158f526c6 [file] [log] [blame]
/**
* Licensed 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.streamnative.pulsar.manager.client.utils;
import org.apache.pulsar.client.api.Message;
import org.apache.pulsar.client.api.MessageId;
import org.apache.pulsar.common.api.EncryptionContext;
import java.util.Map;
import java.util.Optional;
/**
* Implements interface Message for test.
*/
public class TestMessage implements Message {
private byte[] data;
private Object value;
private MessageId messageId;
@Override
public Map<String, String> getProperties() {
return null;
}
@Override
public boolean hasProperty(String s) {
return false;
}
@Override
public String getProperty(String s) {
return null;
}
@Override
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
@Override
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
@Override
public MessageId getMessageId() {
return messageId;
}
public void setMessageId(MessageId messageId) {
this.messageId = messageId;
}
@Override
public long getPublishTime() {
return 0;
}
@Override
public long getEventTime() {
return 0;
}
@Override
public long getSequenceId() {
return 0;
}
@Override
public String getProducerName() {
return null;
}
@Override
public boolean hasKey() {
return false;
}
@Override
public String getKey() {
return null;
}
@Override
public boolean hasBase64EncodedKey() {
return false;
}
@Override
public byte[] getKeyBytes() {
return new byte[0];
}
@Override
public boolean hasOrderingKey() {
return false;
}
@Override
public byte[] getOrderingKey() {
return new byte[0];
}
@Override
public String getTopicName() {
return null;
}
@Override
public Optional<EncryptionContext> getEncryptionCtx() {
return Optional.empty();
}
@Override
public int getRedeliveryCount() {
return 0;
}
@Override
public byte[] getSchemaVersion() {
return new byte[0];
}
@Override
public boolean isReplicated() {
return false;
}
@Override
public String getReplicatedFrom() {
return null;
}
}