Tabnine Logo
ThriftFieldMetadata.isWriteOnly
Code IndexAdd Tabnine to your IDE (free)

How to use
isWriteOnly
method
in
com.facebook.swift.codec.metadata.ThriftFieldMetadata

Best Java code snippets using com.facebook.swift.codec.metadata.ThriftFieldMetadata.isWriteOnly (Showing top 6 results out of 315)

origin: com.gitee.l0km/common-thrifty

try {
  if (field.isWriteOnly()) {
    continue;
origin: com.gitee.l0km/common-thrift

try {
  if (field.isWriteOnly()) {
    continue;
origin: com.facebook.swift/swift-codec

  private <T> void verifyField(ThriftStructMetadata metadata, int id, String name)
  {
    ThriftFieldMetadata messageField = metadata.getField(id);
    assertNotNull(messageField, "field '" + name + "' is null");
    assertEquals(messageField.getId(), id);
    assertEquals(messageField.getName(), name);
    assertFalse(messageField.isReadOnly());
    assertFalse(messageField.isWriteOnly());

    assertTrue(messageField.getExtraction().isPresent());
    ThriftExtraction extraction = messageField.getExtraction().get();
    assertEquals(extraction.getId(), id);
    assertEquals(extraction.getName(), name);

    assertNotNull(messageField.getInjections());
    assertEquals(messageField.getInjections().size(), 1);
    ThriftInjection injection = messageField.getInjections().get(0);
    assertEquals(injection.getId(), id);
    assertEquals(injection.getName(), name);
  }
}
origin: com.facebook.swift/swift-codec

  private <T> void verifyField(ThriftStructMetadata metadata, int id, String name)
  {
    ThriftFieldMetadata metadataField = metadata.getField(id);
    assertNotNull(metadataField, "metadataField is null");
    assertEquals(metadataField.getId(), id);
    assertEquals(metadataField.getName(), name);
    assertFalse(metadataField.isReadOnly());
    assertFalse(metadataField.isWriteOnly());

    assertTrue(metadataField.getExtraction().isPresent());
    ThriftExtraction extraction = metadataField.getExtraction().get();
    assertEquals(extraction.getId(), id);
    assertEquals(extraction.getName(), name);

    assertNotNull(metadataField.getInjections());
    assertEquals(metadataField.getInjections().size(), 1);
    ThriftInjection injection = metadataField.getInjections().get(0);
    assertEquals(injection.getId(), id);
    assertEquals(injection.getName(), name);
  }
}
origin: com.facebook.swift/swift-codec

if (field.isWriteOnly() || field.getType() != THRIFT_FIELD) {
  reader.skipFieldData();
  continue;
origin: com.facebook.swift/swift-codec

@Override
public void write(T instance, TProtocol protocol)
    throws Exception
{
  TProtocolWriter writer = new TProtocolWriter(protocol);
  writer.writeStructBegin(metadata.getStructName());
  for (ThriftFieldMetadata fieldMetadata : metadata.getFields(THRIFT_FIELD)) {
    // is the field readable?
    if (fieldMetadata.isWriteOnly()) {
      continue;
    }
    // get the field value
    Object fieldValue = getFieldValue(instance, fieldMetadata);
    // write the field
    if (fieldValue != null) {
      @SuppressWarnings("unchecked")
      ThriftCodec<Object> codec = (ThriftCodec<Object>) fields.get(fieldMetadata.getId());
      writer.writeField(fieldMetadata.getName(), fieldMetadata.getId(), codec, fieldValue);
    }
  }
  writer.writeStructEnd();
}
com.facebook.swift.codec.metadataThriftFieldMetadataisWriteOnly

Popular methods of ThriftFieldMetadata

  • getId
  • getName
  • getRequiredness
  • getThriftType
  • getConstructorInjection
  • getExtraction
  • getInjections
  • getType
  • getCoercion
  • getMethodInjection
  • <init>
  • isReadOnly
  • <init>,
  • isReadOnly,
  • isTypePredicate,
  • getIdGetter,
  • getIdlAnnotations,
  • isRecursiveReference,
  • isTypeReferenceRecursive

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now