{{! Copyright (c) Meta Platforms, Inc. and its affiliates. 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. }} {{> AutoGenerated}} package {{struct:javaPackage}}; import com.facebook.swift.codec.*; import com.facebook.swift.codec.ThriftField.Requiredness; import com.facebook.swift.codec.ThriftField.Recursiveness; import com.google.common.collect.*; import java.util.*; import javax.annotation.Nullable; import org.apache.thrift.*; import org.apache.thrift.transport.*; import org.apache.thrift.protocol.*; import static com.google.common.base.MoreObjects.toStringHelper; import static com.google.common.base.MoreObjects.ToStringHelper; @SwiftGenerated {{#struct:asBean?}} @com.facebook.swift.codec.ThriftStruct("{{struct:name}}"){{> common/ObjectCustomAnnotation}} {{/struct:asBean?}} {{^struct:asBean?}} @com.facebook.swift.codec.ThriftStruct(value="{{struct:name}}", builder={{struct:javaCapitalName}}.Builder.class){{> common/ObjectCustomAnnotation}} {{/struct:asBean?}} public final class {{struct:javaCapitalName}} implements com.facebook.thrift.payload.ThriftSerializable { {{> struct/ThriftConstructor}} {{> struct/StructBuilder}} {{> struct/AdapterDefinition}} public static final Map NAMES_TO_IDS = new HashMap(); public static final Map THRIFT_NAMES_TO_IDS = new HashMap(); public static final Map FIELD_METADATA = new HashMap<>(); private static final TStruct STRUCT_DESC = new TStruct("{{struct:name}}"); {{#struct:fields}}{{! }}{{#struct:asBean?}} {{#field:isSensitive?}} @org.apache.thrift.annotations.Sensitive {{/field:isSensitive?}} private {{> FieldType}} {{field:javaName}}; public static final int _{{field:javaAllCapsName}} = {{field:key}}; private static final TField {{field:javaTFieldName}} = new TField("{{field:name}}", TType.{{#field:type}}{{> TType}}{{/field:type}}, (short){{field:key}}); {{/struct:asBean?}}{{! }}{{^struct:asBean?}} {{#field:isSensitive?}} @org.apache.thrift.annotations.Sensitive {{/field:isSensitive?}} {{#field:javaAnnotations?}}{{field:javaAnnotations}} {{/field:javaAnnotations?}}private {{^struct:isBigStruct?}}{{^struct:hasWrapper?}}final {{/struct:hasWrapper?}}{{/struct:isBigStruct?}}{{> FieldType}} {{field:javaName}}; public static final int _{{field:javaAllCapsName}} = {{field:key}}; private static final TField {{field:javaTFieldName}} = new TField("{{field:name}}", TType.{{#field:type}}{{> TType}}{{/field:type}}, (short){{field:key}}); {{/struct:asBean?}} {{/struct:fields}}{{! }}static { {{#struct:fields}} NAMES_TO_IDS.put("{{field:javaName}}", {{field:key}}); THRIFT_NAMES_TO_IDS.put("{{field:name}}", {{field:key}}); FIELD_METADATA.put({{field:key}}, {{field:javaTFieldName}}); {{/struct:fields}} {{#struct:thrift_uri}} com.facebook.thrift.type.TypeRegistry.add(new com.facebook.thrift.type.Type( new com.facebook.thrift.type.UniversalName("{{struct:thrift_uri}}"), {{struct:javaCapitalName}}.class, {{struct:javaCapitalName}}::read0)); {{/struct:thrift_uri}} }{{! }}{{#struct:fields}} {{> struct/FieldGetter}}{{! }}{{#struct:asBean?}} {{> struct/FieldSetter}} {{/struct:asBean?}}{{! }} {{/struct:fields}} {{> struct/StructToString}} {{> struct/StructEquals}} {{> struct/StructHashCode}} {{> struct/StructRead}} {{> struct/StructWrite}} {{^struct:asBean?}} {{> Default}} {{/struct:asBean?}} }