org.apache.activemq.store.kahadb.data.KahaDestination Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of activemq-core Show documentation
Show all versions of activemq-core Show documentation
The ActiveMQ Message Broker and Client implementations
//
// Generated by protoc, do not edit by hand.
//
package org.apache.activemq.store.kahadb.data;
public final class KahaDestination extends KahaDestinationBase {
public static enum DestinationType {
QUEUE("QUEUE", 0),
TOPIC("TOPIC", 1),
TEMP_QUEUE("TEMP_QUEUE", 2),
TEMP_TOPIC("TEMP_TOPIC", 3);
private final String name;
private final int value;
private DestinationType(String name, int value) {
this.name = name;
this.value = value;
}
public final int getNumber() {
return value;
}
public final String toString() {
return name;
}
public static DestinationType valueOf(int value) {
switch (value) {
case 0:
return QUEUE;
case 1:
return TOPIC;
case 2:
return TEMP_QUEUE;
case 3:
return TEMP_TOPIC;
default:
return null;
}
}
}
public java.util.ArrayList missingFields() {
java.util.ArrayList missingFields = super.missingFields();
if( !hasType() ) {
missingFields.add("type");
}
if( !hasName() ) {
missingFields.add("name");
}
return missingFields;
}
public void clear() {
super.clear();
clearType();
clearName();
}
public KahaDestination clone() {
return new KahaDestination().mergeFrom(this);
}
public KahaDestination mergeFrom(KahaDestination other) {
if (other.hasType()) {
setType(other.getType());
}
if (other.hasName()) {
setName(other.getName());
}
return this;
}
public int serializedSizeUnframed() {
if (memoizedSerializedSize != -1)
return memoizedSerializedSize;
int size = 0;
if (hasType()) {
size += org.apache.activemq.protobuf.CodedOutputStream.computeEnumSize(1, getType().getNumber());
}
if (hasName()) {
size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(2, getName());
}
memoizedSerializedSize = size;
return size;
}
public KahaDestination mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
while (true) {
int tag = input.readTag();
if ((tag & 0x07) == 4) {
return this;
}
switch (tag) {
case 0:
return this;
default: {
break;
}
case 8:
{
int t = input.readEnum();
KahaDestination.DestinationType value = KahaDestination.DestinationType.valueOf(t);
if( value !=null ) {
setType(value);
}
}
break;
case 18:
setName(input.readString());
break;
}
}
}
public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
if (hasType()) {
output.writeEnum(1, getType().getNumber());
}
if (hasName()) {
output.writeString(2, getName());
}
}
public static KahaDestination parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaDestination().mergeUnframed(data).checktInitialized();
}
public static KahaDestination parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaDestination().mergeUnframed(data).checktInitialized();
}
public static KahaDestination parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaDestination().mergeUnframed(data).checktInitialized();
}
public static KahaDestination parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaDestination().mergeUnframed(data).checktInitialized();
}
public static KahaDestination parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaDestination().mergeFramed(data).checktInitialized();
}
public static KahaDestination parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaDestination().mergeFramed(data).checktInitialized();
}
public static KahaDestination parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaDestination().mergeFramed(data).checktInitialized();
}
public static KahaDestination parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaDestination().mergeFramed(data).checktInitialized();
}
public String toString() {
return toString(new java.lang.StringBuilder(), "").toString();
}
public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
if( hasType() ) {
sb.append(prefix+"type: ");
sb.append(getType());
sb.append("\n");
}
if( hasName() ) {
sb.append(prefix+"name: ");
sb.append(getName());
sb.append("\n");
}
return sb;
}
public boolean equals(Object obj) {
if( obj==this )
return true;
if( obj==null || obj.getClass()!=KahaDestination.class )
return false;
return equals((KahaDestination)obj);
}
public boolean equals(KahaDestination obj) {
if (hasType() ^ obj.hasType() )
return false;
if (hasType() && ( !getType().equals(obj.getType()) ))
return false;
if (hasName() ^ obj.hasName() )
return false;
if (hasName() && ( !getName().equals(obj.getName()) ))
return false;
return true;
}
public int hashCode() {
int rc=-972308577;
if (hasType()) {
rc ^= ( 2622298^getType().hashCode() );
}
if (hasName()) {
rc ^= ( 2420395^getName().hashCode() );
}
return rc;
}
}
abstract class KahaDestinationBase extends org.apache.activemq.protobuf.BaseMessage {
// required DestinationType type = 1;
private KahaDestination.DestinationType f_type = KahaDestination.DestinationType.QUEUE;
private boolean b_type;
public boolean hasType() {
return this.b_type;
}
public KahaDestination.DestinationType getType() {
return this.f_type;
}
public T setType(KahaDestination.DestinationType type) {
loadAndClear();
this.b_type = true;
this.f_type = type;
return (T)this;
}
public void clearType() {
loadAndClear();
this.b_type = false;
this.f_type = KahaDestination.DestinationType.QUEUE;
}
// required string name = 2;
private java.lang.String f_name = null;
private boolean b_name;
public boolean hasName() {
return this.b_name;
}
public java.lang.String getName() {
return this.f_name;
}
public T setName(java.lang.String name) {
loadAndClear();
this.b_name = true;
this.f_name = name;
return (T)this;
}
public void clearName() {
loadAndClear();
this.b_name = false;
this.f_name = null;
}
}