Skip to content

Commit

Permalink
Merge branch 'apache:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
s-clauw authored Sep 30, 2024
2 parents 2caad99 + ad5b27e commit baf8f1e
Show file tree
Hide file tree
Showing 12 changed files with 724 additions and 245 deletions.
3 changes: 3 additions & 0 deletions components/camel-thrift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ If its succesful, you can type

thrift --version

TIP: On mac you can install thrift via brew


To display the version of the thrift compiler.

You then need to compile the sample test source for the `camel-thrift` component.
Expand Down
25 changes: 25 additions & 0 deletions components/camel-thrift/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,29 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<configuration>
<target>
<replace token= "@javax.annotation.Generated"
value="@jakarta.annotation.Generated"
dir="src/test/java">
<include name="**/*.java"/>
</replace>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
* limitations under the License.
*/
/**
* Autogenerated by Thrift Compiler (0.10.0)
* Autogenerated by Thrift Compiler (0.21.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.camel.component.thrift.generated;

@SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" })
/**
* Structs can also be exceptions, if they are nasty.
*/
@javax.annotation.processing.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-06-14")
@SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" })
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.21.0)", date = "2024-09-30")
public class InvalidOperation extends org.apache.thrift.TException
implements org.apache.thrift.TBase<InvalidOperation, InvalidOperation._Fields>, java.io.Serializable, Cloneable,
Comparable<InvalidOperation> {
Expand All @@ -43,14 +43,15 @@ public class InvalidOperation extends org.apache.thrift.TException
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new InvalidOperationTupleSchemeFactory();

public int whatOp; // required
public java.lang.String why; // required
public @org.apache.thrift.annotation.Nullable java.lang.String why; // required

/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
WHAT_OP((short) 1, "whatOp"),
WHY((short) 2, "why");

private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<>();
private static final java.util.Map<java.lang.String, _Fields> byName
= new java.util.HashMap<java.lang.String, _Fields>();

static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
Expand All @@ -61,6 +62,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch (fieldId) {
case 1: // WHAT_OP
Expand All @@ -85,6 +87,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) {
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
Expand All @@ -97,10 +100,12 @@ public static _Fields findByName(java.lang.String name) {
_fieldName = fieldName;
}

@Override
public short getThriftFieldId() {
return _thriftId;
}

@Override
public java.lang.String getFieldName() {
return _fieldName;
}
Expand All @@ -111,7 +116,8 @@ public java.lang.String getFieldName() {
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class);
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap
= new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.WHAT_OP,
new org.apache.thrift.meta_data.FieldMetaData(
"whatOp", org.apache.thrift.TFieldRequirementType.DEFAULT,
Expand Down Expand Up @@ -147,6 +153,7 @@ public InvalidOperation(InvalidOperation other) {
}
}

@Override
public InvalidOperation deepCopy() {
return new InvalidOperation(this);
}
Expand Down Expand Up @@ -181,11 +188,12 @@ public void setWhatOpIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __WHATOP_ISSET_ID, value);
}

@org.apache.thrift.annotation.Nullable
public java.lang.String getWhy() {
return this.why;
}

public InvalidOperation setWhy(java.lang.String why) {
public InvalidOperation setWhy(@org.apache.thrift.annotation.Nullable java.lang.String why) {
this.why = why;
return this;
}
Expand All @@ -205,7 +213,8 @@ public void setWhyIsSet(boolean value) {
}
}

public void setFieldValue(_Fields field, java.lang.Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case WHAT_OP:
if (value == null) {
Expand All @@ -226,6 +235,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) {
}
}

@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case WHAT_OP:
Expand All @@ -239,6 +250,7 @@ public java.lang.Object getFieldValue(_Fields field) {
}

/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
Expand All @@ -255,8 +267,6 @@ public boolean isSet(_Fields field) {

@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof InvalidOperation)
return this.equals((InvalidOperation) that);
return false;
Expand Down Expand Up @@ -310,7 +320,7 @@ public int compareTo(InvalidOperation other) {

int lastComparison = 0;

lastComparison = java.lang.Boolean.valueOf(isSetWhatOp()).compareTo(other.isSetWhatOp());
lastComparison = java.lang.Boolean.compare(isSetWhatOp(), other.isSetWhatOp());
if (lastComparison != 0) {
return lastComparison;
}
Expand All @@ -320,7 +330,7 @@ public int compareTo(InvalidOperation other) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetWhy()).compareTo(other.isSetWhy());
lastComparison = java.lang.Boolean.compare(isSetWhy(), other.isSetWhy());
if (lastComparison != 0) {
return lastComparison;
}
Expand All @@ -333,14 +343,18 @@ public int compareTo(InvalidOperation other) {
return 0;
}

@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}

@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}

@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
Expand All @@ -366,7 +380,7 @@ public java.lang.String toString() {
return sb.toString();
}

public void validate() {
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
Expand All @@ -390,13 +404,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException
}

private static class InvalidOperationStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public InvalidOperationStandardScheme getScheme() {
return new InvalidOperationStandardScheme();
}
}

private static class InvalidOperationStandardScheme extends org.apache.thrift.scheme.StandardScheme<InvalidOperation> {

@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidOperation struct)
throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
Expand Down Expand Up @@ -434,6 +450,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidOperation st
struct.validate();
}

@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, InvalidOperation struct)
throws org.apache.thrift.TException {
struct.validate();
Expand All @@ -454,6 +471,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, InvalidOperation s
}

private static class InvalidOperationTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public InvalidOperationTupleScheme getScheme() {
return new InvalidOperationTupleScheme();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/
/**
* Autogenerated by Thrift Compiler (0.10.0)
* Autogenerated by Thrift Compiler (0.21.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
Expand All @@ -26,6 +26,7 @@
* You can define enums, which are just 32 bit integers. Values are optional and start at 1 if not supplied, C style
* again.
*/
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.21.0)", date = "2024-09-30")
public enum Operation implements org.apache.thrift.TEnum {
ADD(1),
SUBTRACT(2),
Expand All @@ -51,6 +52,7 @@ public int getValue() {
*
* @return null if the value is not found.
*/
@org.apache.thrift.annotation.Nullable
public static Operation findByValue(int value) {
switch (value) {
case 1:
Expand Down
Loading

0 comments on commit baf8f1e

Please sign in to comment.