org.apache.activemq.store.kahadb.data.KahaRewrittenDataFileCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of activemq-osgi Show documentation
Show all versions of activemq-osgi Show documentation
Puts together an ActiveMQ OSGi bundle
//
// Generated by protoc, do not edit by hand.
//
package org.apache.activemq.store.kahadb.data;
public final class KahaRewrittenDataFileCommand extends KahaRewrittenDataFileCommandBase implements org.apache.activemq.store.kahadb.JournalCommand {
public java.util.ArrayList missingFields() {
java.util.ArrayList missingFields = super.missingFields();
if( !hasSourceDataFileId() ) {
missingFields.add("sourceDataFileId");
}
return missingFields;
}
public void clear() {
super.clear();
clearSourceDataFileId();
clearRewriteType();
clearSkipIfSourceExists();
}
public KahaRewrittenDataFileCommand clone() {
return new KahaRewrittenDataFileCommand().mergeFrom(this);
}
public KahaRewrittenDataFileCommand mergeFrom(KahaRewrittenDataFileCommand other) {
if (other.hasSourceDataFileId()) {
setSourceDataFileId(other.getSourceDataFileId());
}
if (other.hasRewriteType()) {
setRewriteType(other.getRewriteType());
}
if (other.hasSkipIfSourceExists()) {
setSkipIfSourceExists(other.getSkipIfSourceExists());
}
return this;
}
public int serializedSizeUnframed() {
if (memoizedSerializedSize != -1)
return memoizedSerializedSize;
int size = 0;
if (hasSourceDataFileId()) {
size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(1, getSourceDataFileId());
}
if (hasRewriteType()) {
size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(2, getRewriteType());
}
if (hasSkipIfSourceExists()) {
size += org.apache.activemq.protobuf.CodedOutputStream.computeBoolSize(3, getSkipIfSourceExists());
}
memoizedSerializedSize = size;
return size;
}
public KahaRewrittenDataFileCommand 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:
setSourceDataFileId(input.readInt32());
break;
case 16:
setRewriteType(input.readInt32());
break;
case 24:
setSkipIfSourceExists(input.readBool());
break;
}
}
}
public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
if (hasSourceDataFileId()) {
output.writeInt32(1, getSourceDataFileId());
}
if (hasRewriteType()) {
output.writeInt32(2, getRewriteType());
}
if (hasSkipIfSourceExists()) {
output.writeBool(3, getSkipIfSourceExists());
}
}
public static KahaRewrittenDataFileCommand parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaRewrittenDataFileCommand().mergeUnframed(data).checktInitialized();
}
public static KahaRewrittenDataFileCommand parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaRewrittenDataFileCommand().mergeUnframed(data).checktInitialized();
}
public static KahaRewrittenDataFileCommand parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaRewrittenDataFileCommand().mergeUnframed(data).checktInitialized();
}
public static KahaRewrittenDataFileCommand parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaRewrittenDataFileCommand().mergeUnframed(data).checktInitialized();
}
public static KahaRewrittenDataFileCommand parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaRewrittenDataFileCommand().mergeFramed(data).checktInitialized();
}
public static KahaRewrittenDataFileCommand parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaRewrittenDataFileCommand().mergeFramed(data).checktInitialized();
}
public static KahaRewrittenDataFileCommand parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaRewrittenDataFileCommand().mergeFramed(data).checktInitialized();
}
public static KahaRewrittenDataFileCommand parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaRewrittenDataFileCommand().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( hasSourceDataFileId() ) {
sb.append(prefix+"sourceDataFileId: ");
sb.append(getSourceDataFileId());
sb.append("\n");
}
if( hasRewriteType() ) {
sb.append(prefix+"rewriteType: ");
sb.append(getRewriteType());
sb.append("\n");
}
if( hasSkipIfSourceExists() ) {
sb.append(prefix+"skipIfSourceExists: ");
sb.append(getSkipIfSourceExists());
sb.append("\n");
}
return sb;
}
public void visit(org.apache.activemq.store.kahadb.Visitor visitor) throws java.io.IOException {
visitor.visit(this);
}
public KahaEntryType type() {
return KahaEntryType.KAHA_REWRITTEN_DATA_FILE_COMMAND;
}
public boolean equals(Object obj) {
if( obj==this )
return true;
if( obj==null || obj.getClass()!=KahaRewrittenDataFileCommand.class )
return false;
return equals((KahaRewrittenDataFileCommand)obj);
}
public boolean equals(KahaRewrittenDataFileCommand obj) {
if (hasSourceDataFileId() ^ obj.hasSourceDataFileId() )
return false;
if (hasSourceDataFileId() && ( getSourceDataFileId()!=obj.getSourceDataFileId() ))
return false;
if (hasRewriteType() ^ obj.hasRewriteType() )
return false;
if (hasRewriteType() && ( getRewriteType()!=obj.getRewriteType() ))
return false;
if (hasSkipIfSourceExists() ^ obj.hasSkipIfSourceExists() )
return false;
if (hasSkipIfSourceExists() && ( getSkipIfSourceExists()!=obj.getSkipIfSourceExists() ))
return false;
return true;
}
public int hashCode() {
int rc=-1065231344;
if (hasSourceDataFileId()) {
rc ^= ( -315365732^getSourceDataFileId() );
}
if (hasRewriteType()) {
rc ^= ( -1100466490^getRewriteType() );
}
if (hasSkipIfSourceExists()) {
rc ^= ( -120419949^ (getSkipIfSourceExists()? 3:-3) );
}
return rc;
}
}
abstract class KahaRewrittenDataFileCommandBase extends org.apache.activemq.protobuf.BaseMessage {
// required int32 sourceDataFileId = 1;
private int f_sourceDataFileId = 0;
private boolean b_sourceDataFileId;
public boolean hasSourceDataFileId() {
return this.b_sourceDataFileId;
}
public int getSourceDataFileId() {
return this.f_sourceDataFileId;
}
public T setSourceDataFileId(int sourceDataFileId) {
loadAndClear();
this.b_sourceDataFileId = true;
this.f_sourceDataFileId = sourceDataFileId;
return (T)this;
}
public void clearSourceDataFileId() {
loadAndClear();
this.b_sourceDataFileId = false;
this.f_sourceDataFileId = 0;
}
// optional int32 rewriteType = 2;
private int f_rewriteType = 0;
private boolean b_rewriteType;
public boolean hasRewriteType() {
return this.b_rewriteType;
}
public int getRewriteType() {
return this.f_rewriteType;
}
public T setRewriteType(int rewriteType) {
loadAndClear();
this.b_rewriteType = true;
this.f_rewriteType = rewriteType;
return (T)this;
}
public void clearRewriteType() {
loadAndClear();
this.b_rewriteType = false;
this.f_rewriteType = 0;
}
// optional bool skipIfSourceExists = 3;
private boolean f_skipIfSourceExists = true;
private boolean b_skipIfSourceExists;
public boolean hasSkipIfSourceExists() {
return this.b_skipIfSourceExists;
}
public boolean getSkipIfSourceExists() {
return this.f_skipIfSourceExists;
}
public T setSkipIfSourceExists(boolean skipIfSourceExists) {
loadAndClear();
this.b_skipIfSourceExists = true;
this.f_skipIfSourceExists = skipIfSourceExists;
return (T)this;
}
public void clearSkipIfSourceExists() {
loadAndClear();
this.b_skipIfSourceExists = false;
this.f_skipIfSourceExists = true;
}
}