Send feedback
Class AdUnitTargeting.Builder (0.27.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version latestkeyboard_arrow_down
public static final class AdUnitTargeting . Builder extends GeneratedMessageV3 . Builder<AdUnitTargeting . Builder > implements AdUnitTargetingOrBuilder
Specifies an ad unit and (optionally) its descendants.
Protobuf type google.ads.admanager.v1.AdUnitTargeting
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public AdUnitTargeting . Builder addRepeatedField ( Descriptors . FieldDescriptor field , Object value )
Overrides
build()
public AdUnitTargeting build ()
buildPartial()
public AdUnitTargeting buildPartial ()
clear()
public AdUnitTargeting . Builder clear ()
Overrides
clearAdUnit()
public AdUnitTargeting . Builder clearAdUnit ()
Optional. The resource name of this ad unit.
optional string ad_unit = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
clearField(Descriptors.FieldDescriptor field)
public AdUnitTargeting . Builder clearField ( Descriptors . FieldDescriptor field )
Overrides
clearIncludeDescendants()
public AdUnitTargeting . Builder clearIncludeDescendants ()
Whether this ad unit's children should be targeted/excluded as well.
optional bool include_descendants = 1;
clearOneof(Descriptors.OneofDescriptor oneof)
public AdUnitTargeting . Builder clearOneof ( Descriptors . OneofDescriptor oneof )
Overrides
clone()
public AdUnitTargeting . Builder clone ()
Overrides
getAdUnit()
public String getAdUnit ()
Optional. The resource name of this ad unit.
optional string ad_unit = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
Returns
Type
Description
String
The adUnit.
getAdUnitBytes()
public ByteString getAdUnitBytes ()
Optional. The resource name of this ad unit.
optional string ad_unit = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
Returns
Type
Description
ByteString
The bytes for adUnit.
getDefaultInstanceForType()
public AdUnitTargeting getDefaultInstanceForType ()
getDescriptorForType()
public Descriptors . Descriptor getDescriptorForType ()
Overrides
getIncludeDescendants()
public boolean getIncludeDescendants ()
Whether this ad unit's children should be targeted/excluded as well.
optional bool include_descendants = 1;
Returns
Type
Description
boolean
The includeDescendants.
hasAdUnit()
public boolean hasAdUnit ()
Optional. The resource name of this ad unit.
optional string ad_unit = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
Returns
Type
Description
boolean
Whether the adUnit field is set.
hasIncludeDescendants()
public boolean hasIncludeDescendants ()
Whether this ad unit's children should be targeted/excluded as well.
optional bool include_descendants = 1;
Returns
Type
Description
boolean
Whether the includeDescendants field is set.
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
isInitialized()
public final boolean isInitialized ()
Overrides
mergeFrom(AdUnitTargeting other)
public AdUnitTargeting . Builder mergeFrom ( AdUnitTargeting other )
public AdUnitTargeting . Builder mergeFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
Overrides
mergeFrom(Message other)
public AdUnitTargeting . Builder mergeFrom ( Message other )
Parameter
Name
Description
other
Message
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final AdUnitTargeting . Builder mergeUnknownFields ( UnknownFieldSet unknownFields )
Overrides
setAdUnit(String value)
public AdUnitTargeting . Builder setAdUnit ( String value )
Optional. The resource name of this ad unit.
optional string ad_unit = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
Parameter
Name
Description
value
String
The adUnit to set.
setAdUnitBytes(ByteString value)
public AdUnitTargeting . Builder setAdUnitBytes ( ByteString value )
Optional. The resource name of this ad unit.
optional string ad_unit = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
Parameter
Name
Description
value
ByteString
The bytes for adUnit to set.
setField(Descriptors.FieldDescriptor field, Object value)
public AdUnitTargeting . Builder setField ( Descriptors . FieldDescriptor field , Object value )
Overrides
setIncludeDescendants(boolean value)
public AdUnitTargeting . Builder setIncludeDescendants ( boolean value )
Whether this ad unit's children should be targeted/excluded as well.
optional bool include_descendants = 1;
Parameter
Name
Description
value
boolean
The includeDescendants to set.
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public AdUnitTargeting . Builder setRepeatedField ( Descriptors . FieldDescriptor field , int index , Object value )
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final AdUnitTargeting . Builder setUnknownFields ( UnknownFieldSet unknownFields )
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-17 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-17 UTC."],[],[]]