Java Code Examples for com.google.protobuf.Descriptors.FieldDescriptor#getContainingType()

The following examples show how to use com.google.protobuf.Descriptors.FieldDescriptor#getContainingType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DynamicMessage.java    From play-store-api with GNU General Public License v3.0 5 votes vote down vote up
/** Verifies that the field is a field of this message. */
private void verifyContainingType(FieldDescriptor field) {
  if (field.getContainingType() != type) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 2
Source File: DynamicMessage.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** Verifies that the field is a field of this message. */
private void verifyContainingType(FieldDescriptor field) {
  if (field.getContainingType() != type) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 3
Source File: GeneratedMessage.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/** Get the FieldAccessor for a particular field. */
private FieldAccessor getField(final FieldDescriptor field) {
  if (field.getContainingType() != descriptor) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  } else if (field.isExtension()) {
    // If this type had extensions, it would subclass ExtendableMessage,
    // which overrides the reflection interface to handle extensions.
    throw new IllegalArgumentException(
      "This type does not have extensions.");
  }
  return fields[field.getIndex()];
}
 
Example 4
Source File: GeneratedMessage.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** Get the FieldAccessor for a particular field. */
private FieldAccessor getField(final FieldDescriptor field) {
  if (field.getContainingType() != descriptor) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  } else if (field.isExtension()) {
    // If this type had extensions, it would subclass ExtendableMessage,
    // which overrides the reflection interface to handle extensions.
    throw new IllegalArgumentException(
      "This type does not have extensions.");
  }
  return fields[field.getIndex()];
}
 
Example 5
Source File: DynamicMessage.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/** Verifies that the field is a field of this message. */
private void verifyContainingType(FieldDescriptor field) {
  if (field.getContainingType() != type) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 6
Source File: DynamicMessage.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/** Verifies that the field is a field of this message. */
private void verifyContainingType(FieldDescriptor field) {
  if (field.getContainingType() != type) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 7
Source File: GeneratedMessage.java    From travelguide with Apache License 2.0 5 votes vote down vote up
/** Get the FieldAccessor for a particular field. */
private FieldAccessor getField(final FieldDescriptor field) {
  if (field.getContainingType() != descriptor) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  } else if (field.isExtension()) {
    // If this type had extensions, it would subclass ExtendableMessage,
    // which overrides the reflection interface to handle extensions.
    throw new IllegalArgumentException(
      "This type does not have extensions.");
  }
  return fields[field.getIndex()];
}
 
Example 8
Source File: DynamicMessage.java    From travelguide with Apache License 2.0 5 votes vote down vote up
/** Verifies that the field is a field of this message. */
private void verifyContainingType(FieldDescriptor field) {
  if (field.getContainingType() != type) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 9
Source File: DynamicMessage.java    From travelguide with Apache License 2.0 5 votes vote down vote up
/** Verifies that the field is a field of this message. */
private void verifyContainingType(FieldDescriptor field) {
  if (field.getContainingType() != type) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 10
Source File: DynamicMessage.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** Verifies that the field is a field of this message. */
private void verifyContainingType(FieldDescriptor field) {
  if (field.getContainingType() != type) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 11
Source File: MapEntry.java    From play-store-api with GNU General Public License v3.0 5 votes vote down vote up
private void checkFieldDescriptor(FieldDescriptor field) {
  if (field.getContainingType() != metadata.descriptor) {
    throw new RuntimeException(
        "Wrong FieldDescriptor \"" + field.getFullName()
        + "\" used in message \"" + metadata.descriptor.getFullName());
  }
}
 
Example 12
Source File: GeneratedMessage.java    From play-store-api with GNU General Public License v3.0 5 votes vote down vote up
/** Get the FieldAccessor for a particular field. */
private FieldAccessor getField(final FieldDescriptor field) {
  if (field.getContainingType() != descriptor) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  } else if (field.isExtension()) {
    // If this type had extensions, it would subclass ExtendableMessage,
    // which overrides the reflection interface to handle extensions.
    throw new IllegalArgumentException(
      "This type does not have extensions.");
  }
  return fields[field.getIndex()];
}
 
Example 13
Source File: GeneratedMessage.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/** Get the FieldAccessor for a particular field. */
private FieldAccessor getField(final FieldDescriptor field) {
  if (field.getContainingType() != descriptor) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  } else if (field.isExtension()) {
    // If this type had extensions, it would subclass ExtendableMessage,
    // which overrides the reflection interface to handle extensions.
    throw new IllegalArgumentException(
      "This type does not have extensions.");
  }
  return fields[field.getIndex()];
}
 
Example 14
Source File: DynamicMessage.java    From play-store-api with GNU General Public License v3.0 5 votes vote down vote up
/** Verifies that the field is a field of this message. */
private void verifyContainingType(FieldDescriptor field) {
  if (field.getContainingType() != type) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 15
Source File: GeneratedMessage.java    From travelguide with Apache License 2.0 4 votes vote down vote up
private void verifyContainingType(final FieldDescriptor field) {
  if (field.getContainingType() != getDescriptorForType()) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 16
Source File: GeneratedMessage.java    From travelguide with Apache License 2.0 4 votes vote down vote up
private void verifyContainingType(final FieldDescriptor field) {
  if (field.getContainingType() != getDescriptorForType()) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 17
Source File: GeneratedMessage.java    From play-store-api with GNU General Public License v3.0 4 votes vote down vote up
private void verifyContainingType(final FieldDescriptor field) {
  if (field.getContainingType() != getDescriptorForType()) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 18
Source File: GeneratedMessage.java    From 365browser with Apache License 2.0 4 votes vote down vote up
private void verifyContainingType(final FieldDescriptor field) {
  if (field.getContainingType() != getDescriptorForType()) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 19
Source File: GeneratedMessage.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void verifyContainingType(final FieldDescriptor field) {
  if (field.getContainingType() != getDescriptorForType()) {
    throw new IllegalArgumentException(
      "FieldDescriptor does not match message type.");
  }
}
 
Example 20
Source File: FieldScopeLogic.java    From curiostack with MIT License 4 votes vote down vote up
@Override
boolean matchesFieldDescriptor(Descriptor descriptor, FieldDescriptor fieldDescriptor) {
  return fieldDescriptor.getContainingType() == descriptor
      && fieldNumbers.contains(fieldDescriptor.getNumber());
}