1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/analytics/data/v1beta/data.proto 18 19 package com.google.analytics.data.v1beta; 20 21 /** 22 * 23 * 24 * <pre> 25 * Dimensions are attributes of your data. For example, the dimension city 26 * indicates the city from which an event originates. Dimension values in report 27 * responses are strings; for example, the city could be "Paris" or "New York". 28 * Requests are allowed up to 9 dimensions. 29 * </pre> 30 * 31 * Protobuf type {@code google.analytics.data.v1beta.Dimension} 32 */ 33 public final class Dimension extends com.google.protobuf.GeneratedMessageV3 34 implements 35 // @@protoc_insertion_point(message_implements:google.analytics.data.v1beta.Dimension) 36 DimensionOrBuilder { 37 private static final long serialVersionUID = 0L; 38 // Use Dimension.newBuilder() to construct. Dimension(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)39 private Dimension(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 40 super(builder); 41 } 42 Dimension()43 private Dimension() { 44 name_ = ""; 45 } 46 47 @java.lang.Override 48 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)49 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 50 return new Dimension(); 51 } 52 53 @java.lang.Override getUnknownFields()54 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 55 return this.unknownFields; 56 } 57 getDescriptor()58 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 59 return com.google.analytics.data.v1beta.ReportingApiProto 60 .internal_static_google_analytics_data_v1beta_Dimension_descriptor; 61 } 62 63 @java.lang.Override 64 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()65 internalGetFieldAccessorTable() { 66 return com.google.analytics.data.v1beta.ReportingApiProto 67 .internal_static_google_analytics_data_v1beta_Dimension_fieldAccessorTable 68 .ensureFieldAccessorsInitialized( 69 com.google.analytics.data.v1beta.Dimension.class, 70 com.google.analytics.data.v1beta.Dimension.Builder.class); 71 } 72 73 public static final int NAME_FIELD_NUMBER = 1; 74 75 @SuppressWarnings("serial") 76 private volatile java.lang.Object name_ = ""; 77 /** 78 * 79 * 80 * <pre> 81 * The name of the dimension. See the [API 82 * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) 83 * for the list of dimension names. 84 * If `dimensionExpression` is specified, `name` can be any string that you 85 * would like within the allowed character set. For example if a 86 * `dimensionExpression` concatenates `country` and `city`, you could call 87 * that dimension `countryAndCity`. Dimension names that you choose must match 88 * the regular expression `^[a-zA-Z0-9_]$`. 89 * Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, 90 * `dimensionExpression`, and `pivots`. 91 * </pre> 92 * 93 * <code>string name = 1;</code> 94 * 95 * @return The name. 96 */ 97 @java.lang.Override getName()98 public java.lang.String getName() { 99 java.lang.Object ref = name_; 100 if (ref instanceof java.lang.String) { 101 return (java.lang.String) ref; 102 } else { 103 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 104 java.lang.String s = bs.toStringUtf8(); 105 name_ = s; 106 return s; 107 } 108 } 109 /** 110 * 111 * 112 * <pre> 113 * The name of the dimension. See the [API 114 * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) 115 * for the list of dimension names. 116 * If `dimensionExpression` is specified, `name` can be any string that you 117 * would like within the allowed character set. For example if a 118 * `dimensionExpression` concatenates `country` and `city`, you could call 119 * that dimension `countryAndCity`. Dimension names that you choose must match 120 * the regular expression `^[a-zA-Z0-9_]$`. 121 * Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, 122 * `dimensionExpression`, and `pivots`. 123 * </pre> 124 * 125 * <code>string name = 1;</code> 126 * 127 * @return The bytes for name. 128 */ 129 @java.lang.Override getNameBytes()130 public com.google.protobuf.ByteString getNameBytes() { 131 java.lang.Object ref = name_; 132 if (ref instanceof java.lang.String) { 133 com.google.protobuf.ByteString b = 134 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 135 name_ = b; 136 return b; 137 } else { 138 return (com.google.protobuf.ByteString) ref; 139 } 140 } 141 142 public static final int DIMENSION_EXPRESSION_FIELD_NUMBER = 2; 143 private com.google.analytics.data.v1beta.DimensionExpression dimensionExpression_; 144 /** 145 * 146 * 147 * <pre> 148 * One dimension can be the result of an expression of multiple dimensions. 149 * For example, dimension "country, city": concatenate(country, ", ", city). 150 * </pre> 151 * 152 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 153 * 154 * @return Whether the dimensionExpression field is set. 155 */ 156 @java.lang.Override hasDimensionExpression()157 public boolean hasDimensionExpression() { 158 return dimensionExpression_ != null; 159 } 160 /** 161 * 162 * 163 * <pre> 164 * One dimension can be the result of an expression of multiple dimensions. 165 * For example, dimension "country, city": concatenate(country, ", ", city). 166 * </pre> 167 * 168 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 169 * 170 * @return The dimensionExpression. 171 */ 172 @java.lang.Override getDimensionExpression()173 public com.google.analytics.data.v1beta.DimensionExpression getDimensionExpression() { 174 return dimensionExpression_ == null 175 ? com.google.analytics.data.v1beta.DimensionExpression.getDefaultInstance() 176 : dimensionExpression_; 177 } 178 /** 179 * 180 * 181 * <pre> 182 * One dimension can be the result of an expression of multiple dimensions. 183 * For example, dimension "country, city": concatenate(country, ", ", city). 184 * </pre> 185 * 186 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 187 */ 188 @java.lang.Override 189 public com.google.analytics.data.v1beta.DimensionExpressionOrBuilder getDimensionExpressionOrBuilder()190 getDimensionExpressionOrBuilder() { 191 return dimensionExpression_ == null 192 ? com.google.analytics.data.v1beta.DimensionExpression.getDefaultInstance() 193 : dimensionExpression_; 194 } 195 196 private byte memoizedIsInitialized = -1; 197 198 @java.lang.Override isInitialized()199 public final boolean isInitialized() { 200 byte isInitialized = memoizedIsInitialized; 201 if (isInitialized == 1) return true; 202 if (isInitialized == 0) return false; 203 204 memoizedIsInitialized = 1; 205 return true; 206 } 207 208 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)209 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 210 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 211 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 212 } 213 if (dimensionExpression_ != null) { 214 output.writeMessage(2, getDimensionExpression()); 215 } 216 getUnknownFields().writeTo(output); 217 } 218 219 @java.lang.Override getSerializedSize()220 public int getSerializedSize() { 221 int size = memoizedSize; 222 if (size != -1) return size; 223 224 size = 0; 225 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 226 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 227 } 228 if (dimensionExpression_ != null) { 229 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDimensionExpression()); 230 } 231 size += getUnknownFields().getSerializedSize(); 232 memoizedSize = size; 233 return size; 234 } 235 236 @java.lang.Override equals(final java.lang.Object obj)237 public boolean equals(final java.lang.Object obj) { 238 if (obj == this) { 239 return true; 240 } 241 if (!(obj instanceof com.google.analytics.data.v1beta.Dimension)) { 242 return super.equals(obj); 243 } 244 com.google.analytics.data.v1beta.Dimension other = 245 (com.google.analytics.data.v1beta.Dimension) obj; 246 247 if (!getName().equals(other.getName())) return false; 248 if (hasDimensionExpression() != other.hasDimensionExpression()) return false; 249 if (hasDimensionExpression()) { 250 if (!getDimensionExpression().equals(other.getDimensionExpression())) return false; 251 } 252 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 253 return true; 254 } 255 256 @java.lang.Override hashCode()257 public int hashCode() { 258 if (memoizedHashCode != 0) { 259 return memoizedHashCode; 260 } 261 int hash = 41; 262 hash = (19 * hash) + getDescriptor().hashCode(); 263 hash = (37 * hash) + NAME_FIELD_NUMBER; 264 hash = (53 * hash) + getName().hashCode(); 265 if (hasDimensionExpression()) { 266 hash = (37 * hash) + DIMENSION_EXPRESSION_FIELD_NUMBER; 267 hash = (53 * hash) + getDimensionExpression().hashCode(); 268 } 269 hash = (29 * hash) + getUnknownFields().hashCode(); 270 memoizedHashCode = hash; 271 return hash; 272 } 273 parseFrom(java.nio.ByteBuffer data)274 public static com.google.analytics.data.v1beta.Dimension parseFrom(java.nio.ByteBuffer data) 275 throws com.google.protobuf.InvalidProtocolBufferException { 276 return PARSER.parseFrom(data); 277 } 278 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)279 public static com.google.analytics.data.v1beta.Dimension parseFrom( 280 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 281 throws com.google.protobuf.InvalidProtocolBufferException { 282 return PARSER.parseFrom(data, extensionRegistry); 283 } 284 parseFrom( com.google.protobuf.ByteString data)285 public static com.google.analytics.data.v1beta.Dimension parseFrom( 286 com.google.protobuf.ByteString data) 287 throws com.google.protobuf.InvalidProtocolBufferException { 288 return PARSER.parseFrom(data); 289 } 290 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)291 public static com.google.analytics.data.v1beta.Dimension parseFrom( 292 com.google.protobuf.ByteString data, 293 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 294 throws com.google.protobuf.InvalidProtocolBufferException { 295 return PARSER.parseFrom(data, extensionRegistry); 296 } 297 parseFrom(byte[] data)298 public static com.google.analytics.data.v1beta.Dimension parseFrom(byte[] data) 299 throws com.google.protobuf.InvalidProtocolBufferException { 300 return PARSER.parseFrom(data); 301 } 302 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)303 public static com.google.analytics.data.v1beta.Dimension parseFrom( 304 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 305 throws com.google.protobuf.InvalidProtocolBufferException { 306 return PARSER.parseFrom(data, extensionRegistry); 307 } 308 parseFrom(java.io.InputStream input)309 public static com.google.analytics.data.v1beta.Dimension parseFrom(java.io.InputStream input) 310 throws java.io.IOException { 311 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 312 } 313 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)314 public static com.google.analytics.data.v1beta.Dimension parseFrom( 315 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 316 throws java.io.IOException { 317 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 318 PARSER, input, extensionRegistry); 319 } 320 parseDelimitedFrom( java.io.InputStream input)321 public static com.google.analytics.data.v1beta.Dimension parseDelimitedFrom( 322 java.io.InputStream input) throws java.io.IOException { 323 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 324 } 325 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)326 public static com.google.analytics.data.v1beta.Dimension parseDelimitedFrom( 327 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 328 throws java.io.IOException { 329 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 330 PARSER, input, extensionRegistry); 331 } 332 parseFrom( com.google.protobuf.CodedInputStream input)333 public static com.google.analytics.data.v1beta.Dimension parseFrom( 334 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 335 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 336 } 337 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)338 public static com.google.analytics.data.v1beta.Dimension parseFrom( 339 com.google.protobuf.CodedInputStream input, 340 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 341 throws java.io.IOException { 342 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 343 PARSER, input, extensionRegistry); 344 } 345 346 @java.lang.Override newBuilderForType()347 public Builder newBuilderForType() { 348 return newBuilder(); 349 } 350 newBuilder()351 public static Builder newBuilder() { 352 return DEFAULT_INSTANCE.toBuilder(); 353 } 354 newBuilder(com.google.analytics.data.v1beta.Dimension prototype)355 public static Builder newBuilder(com.google.analytics.data.v1beta.Dimension prototype) { 356 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 357 } 358 359 @java.lang.Override toBuilder()360 public Builder toBuilder() { 361 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 362 } 363 364 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)365 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 366 Builder builder = new Builder(parent); 367 return builder; 368 } 369 /** 370 * 371 * 372 * <pre> 373 * Dimensions are attributes of your data. For example, the dimension city 374 * indicates the city from which an event originates. Dimension values in report 375 * responses are strings; for example, the city could be "Paris" or "New York". 376 * Requests are allowed up to 9 dimensions. 377 * </pre> 378 * 379 * Protobuf type {@code google.analytics.data.v1beta.Dimension} 380 */ 381 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 382 implements 383 // @@protoc_insertion_point(builder_implements:google.analytics.data.v1beta.Dimension) 384 com.google.analytics.data.v1beta.DimensionOrBuilder { getDescriptor()385 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 386 return com.google.analytics.data.v1beta.ReportingApiProto 387 .internal_static_google_analytics_data_v1beta_Dimension_descriptor; 388 } 389 390 @java.lang.Override 391 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()392 internalGetFieldAccessorTable() { 393 return com.google.analytics.data.v1beta.ReportingApiProto 394 .internal_static_google_analytics_data_v1beta_Dimension_fieldAccessorTable 395 .ensureFieldAccessorsInitialized( 396 com.google.analytics.data.v1beta.Dimension.class, 397 com.google.analytics.data.v1beta.Dimension.Builder.class); 398 } 399 400 // Construct using com.google.analytics.data.v1beta.Dimension.newBuilder() Builder()401 private Builder() {} 402 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)403 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 404 super(parent); 405 } 406 407 @java.lang.Override clear()408 public Builder clear() { 409 super.clear(); 410 bitField0_ = 0; 411 name_ = ""; 412 dimensionExpression_ = null; 413 if (dimensionExpressionBuilder_ != null) { 414 dimensionExpressionBuilder_.dispose(); 415 dimensionExpressionBuilder_ = null; 416 } 417 return this; 418 } 419 420 @java.lang.Override getDescriptorForType()421 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 422 return com.google.analytics.data.v1beta.ReportingApiProto 423 .internal_static_google_analytics_data_v1beta_Dimension_descriptor; 424 } 425 426 @java.lang.Override getDefaultInstanceForType()427 public com.google.analytics.data.v1beta.Dimension getDefaultInstanceForType() { 428 return com.google.analytics.data.v1beta.Dimension.getDefaultInstance(); 429 } 430 431 @java.lang.Override build()432 public com.google.analytics.data.v1beta.Dimension build() { 433 com.google.analytics.data.v1beta.Dimension result = buildPartial(); 434 if (!result.isInitialized()) { 435 throw newUninitializedMessageException(result); 436 } 437 return result; 438 } 439 440 @java.lang.Override buildPartial()441 public com.google.analytics.data.v1beta.Dimension buildPartial() { 442 com.google.analytics.data.v1beta.Dimension result = 443 new com.google.analytics.data.v1beta.Dimension(this); 444 if (bitField0_ != 0) { 445 buildPartial0(result); 446 } 447 onBuilt(); 448 return result; 449 } 450 buildPartial0(com.google.analytics.data.v1beta.Dimension result)451 private void buildPartial0(com.google.analytics.data.v1beta.Dimension result) { 452 int from_bitField0_ = bitField0_; 453 if (((from_bitField0_ & 0x00000001) != 0)) { 454 result.name_ = name_; 455 } 456 if (((from_bitField0_ & 0x00000002) != 0)) { 457 result.dimensionExpression_ = 458 dimensionExpressionBuilder_ == null 459 ? dimensionExpression_ 460 : dimensionExpressionBuilder_.build(); 461 } 462 } 463 464 @java.lang.Override clone()465 public Builder clone() { 466 return super.clone(); 467 } 468 469 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)470 public Builder setField( 471 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 472 return super.setField(field, value); 473 } 474 475 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)476 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 477 return super.clearField(field); 478 } 479 480 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)481 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 482 return super.clearOneof(oneof); 483 } 484 485 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)486 public Builder setRepeatedField( 487 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 488 return super.setRepeatedField(field, index, value); 489 } 490 491 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)492 public Builder addRepeatedField( 493 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 494 return super.addRepeatedField(field, value); 495 } 496 497 @java.lang.Override mergeFrom(com.google.protobuf.Message other)498 public Builder mergeFrom(com.google.protobuf.Message other) { 499 if (other instanceof com.google.analytics.data.v1beta.Dimension) { 500 return mergeFrom((com.google.analytics.data.v1beta.Dimension) other); 501 } else { 502 super.mergeFrom(other); 503 return this; 504 } 505 } 506 mergeFrom(com.google.analytics.data.v1beta.Dimension other)507 public Builder mergeFrom(com.google.analytics.data.v1beta.Dimension other) { 508 if (other == com.google.analytics.data.v1beta.Dimension.getDefaultInstance()) return this; 509 if (!other.getName().isEmpty()) { 510 name_ = other.name_; 511 bitField0_ |= 0x00000001; 512 onChanged(); 513 } 514 if (other.hasDimensionExpression()) { 515 mergeDimensionExpression(other.getDimensionExpression()); 516 } 517 this.mergeUnknownFields(other.getUnknownFields()); 518 onChanged(); 519 return this; 520 } 521 522 @java.lang.Override isInitialized()523 public final boolean isInitialized() { 524 return true; 525 } 526 527 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)528 public Builder mergeFrom( 529 com.google.protobuf.CodedInputStream input, 530 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 531 throws java.io.IOException { 532 if (extensionRegistry == null) { 533 throw new java.lang.NullPointerException(); 534 } 535 try { 536 boolean done = false; 537 while (!done) { 538 int tag = input.readTag(); 539 switch (tag) { 540 case 0: 541 done = true; 542 break; 543 case 10: 544 { 545 name_ = input.readStringRequireUtf8(); 546 bitField0_ |= 0x00000001; 547 break; 548 } // case 10 549 case 18: 550 { 551 input.readMessage( 552 getDimensionExpressionFieldBuilder().getBuilder(), extensionRegistry); 553 bitField0_ |= 0x00000002; 554 break; 555 } // case 18 556 default: 557 { 558 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 559 done = true; // was an endgroup tag 560 } 561 break; 562 } // default: 563 } // switch (tag) 564 } // while (!done) 565 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 566 throw e.unwrapIOException(); 567 } finally { 568 onChanged(); 569 } // finally 570 return this; 571 } 572 573 private int bitField0_; 574 575 private java.lang.Object name_ = ""; 576 /** 577 * 578 * 579 * <pre> 580 * The name of the dimension. See the [API 581 * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) 582 * for the list of dimension names. 583 * If `dimensionExpression` is specified, `name` can be any string that you 584 * would like within the allowed character set. For example if a 585 * `dimensionExpression` concatenates `country` and `city`, you could call 586 * that dimension `countryAndCity`. Dimension names that you choose must match 587 * the regular expression `^[a-zA-Z0-9_]$`. 588 * Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, 589 * `dimensionExpression`, and `pivots`. 590 * </pre> 591 * 592 * <code>string name = 1;</code> 593 * 594 * @return The name. 595 */ getName()596 public java.lang.String getName() { 597 java.lang.Object ref = name_; 598 if (!(ref instanceof java.lang.String)) { 599 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 600 java.lang.String s = bs.toStringUtf8(); 601 name_ = s; 602 return s; 603 } else { 604 return (java.lang.String) ref; 605 } 606 } 607 /** 608 * 609 * 610 * <pre> 611 * The name of the dimension. See the [API 612 * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) 613 * for the list of dimension names. 614 * If `dimensionExpression` is specified, `name` can be any string that you 615 * would like within the allowed character set. For example if a 616 * `dimensionExpression` concatenates `country` and `city`, you could call 617 * that dimension `countryAndCity`. Dimension names that you choose must match 618 * the regular expression `^[a-zA-Z0-9_]$`. 619 * Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, 620 * `dimensionExpression`, and `pivots`. 621 * </pre> 622 * 623 * <code>string name = 1;</code> 624 * 625 * @return The bytes for name. 626 */ getNameBytes()627 public com.google.protobuf.ByteString getNameBytes() { 628 java.lang.Object ref = name_; 629 if (ref instanceof String) { 630 com.google.protobuf.ByteString b = 631 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 632 name_ = b; 633 return b; 634 } else { 635 return (com.google.protobuf.ByteString) ref; 636 } 637 } 638 /** 639 * 640 * 641 * <pre> 642 * The name of the dimension. See the [API 643 * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) 644 * for the list of dimension names. 645 * If `dimensionExpression` is specified, `name` can be any string that you 646 * would like within the allowed character set. For example if a 647 * `dimensionExpression` concatenates `country` and `city`, you could call 648 * that dimension `countryAndCity`. Dimension names that you choose must match 649 * the regular expression `^[a-zA-Z0-9_]$`. 650 * Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, 651 * `dimensionExpression`, and `pivots`. 652 * </pre> 653 * 654 * <code>string name = 1;</code> 655 * 656 * @param value The name to set. 657 * @return This builder for chaining. 658 */ setName(java.lang.String value)659 public Builder setName(java.lang.String value) { 660 if (value == null) { 661 throw new NullPointerException(); 662 } 663 name_ = value; 664 bitField0_ |= 0x00000001; 665 onChanged(); 666 return this; 667 } 668 /** 669 * 670 * 671 * <pre> 672 * The name of the dimension. See the [API 673 * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) 674 * for the list of dimension names. 675 * If `dimensionExpression` is specified, `name` can be any string that you 676 * would like within the allowed character set. For example if a 677 * `dimensionExpression` concatenates `country` and `city`, you could call 678 * that dimension `countryAndCity`. Dimension names that you choose must match 679 * the regular expression `^[a-zA-Z0-9_]$`. 680 * Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, 681 * `dimensionExpression`, and `pivots`. 682 * </pre> 683 * 684 * <code>string name = 1;</code> 685 * 686 * @return This builder for chaining. 687 */ clearName()688 public Builder clearName() { 689 name_ = getDefaultInstance().getName(); 690 bitField0_ = (bitField0_ & ~0x00000001); 691 onChanged(); 692 return this; 693 } 694 /** 695 * 696 * 697 * <pre> 698 * The name of the dimension. See the [API 699 * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) 700 * for the list of dimension names. 701 * If `dimensionExpression` is specified, `name` can be any string that you 702 * would like within the allowed character set. For example if a 703 * `dimensionExpression` concatenates `country` and `city`, you could call 704 * that dimension `countryAndCity`. Dimension names that you choose must match 705 * the regular expression `^[a-zA-Z0-9_]$`. 706 * Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, 707 * `dimensionExpression`, and `pivots`. 708 * </pre> 709 * 710 * <code>string name = 1;</code> 711 * 712 * @param value The bytes for name to set. 713 * @return This builder for chaining. 714 */ setNameBytes(com.google.protobuf.ByteString value)715 public Builder setNameBytes(com.google.protobuf.ByteString value) { 716 if (value == null) { 717 throw new NullPointerException(); 718 } 719 checkByteStringIsUtf8(value); 720 name_ = value; 721 bitField0_ |= 0x00000001; 722 onChanged(); 723 return this; 724 } 725 726 private com.google.analytics.data.v1beta.DimensionExpression dimensionExpression_; 727 private com.google.protobuf.SingleFieldBuilderV3< 728 com.google.analytics.data.v1beta.DimensionExpression, 729 com.google.analytics.data.v1beta.DimensionExpression.Builder, 730 com.google.analytics.data.v1beta.DimensionExpressionOrBuilder> 731 dimensionExpressionBuilder_; 732 /** 733 * 734 * 735 * <pre> 736 * One dimension can be the result of an expression of multiple dimensions. 737 * For example, dimension "country, city": concatenate(country, ", ", city). 738 * </pre> 739 * 740 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 741 * 742 * @return Whether the dimensionExpression field is set. 743 */ hasDimensionExpression()744 public boolean hasDimensionExpression() { 745 return ((bitField0_ & 0x00000002) != 0); 746 } 747 /** 748 * 749 * 750 * <pre> 751 * One dimension can be the result of an expression of multiple dimensions. 752 * For example, dimension "country, city": concatenate(country, ", ", city). 753 * </pre> 754 * 755 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 756 * 757 * @return The dimensionExpression. 758 */ getDimensionExpression()759 public com.google.analytics.data.v1beta.DimensionExpression getDimensionExpression() { 760 if (dimensionExpressionBuilder_ == null) { 761 return dimensionExpression_ == null 762 ? com.google.analytics.data.v1beta.DimensionExpression.getDefaultInstance() 763 : dimensionExpression_; 764 } else { 765 return dimensionExpressionBuilder_.getMessage(); 766 } 767 } 768 /** 769 * 770 * 771 * <pre> 772 * One dimension can be the result of an expression of multiple dimensions. 773 * For example, dimension "country, city": concatenate(country, ", ", city). 774 * </pre> 775 * 776 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 777 */ setDimensionExpression( com.google.analytics.data.v1beta.DimensionExpression value)778 public Builder setDimensionExpression( 779 com.google.analytics.data.v1beta.DimensionExpression value) { 780 if (dimensionExpressionBuilder_ == null) { 781 if (value == null) { 782 throw new NullPointerException(); 783 } 784 dimensionExpression_ = value; 785 } else { 786 dimensionExpressionBuilder_.setMessage(value); 787 } 788 bitField0_ |= 0x00000002; 789 onChanged(); 790 return this; 791 } 792 /** 793 * 794 * 795 * <pre> 796 * One dimension can be the result of an expression of multiple dimensions. 797 * For example, dimension "country, city": concatenate(country, ", ", city). 798 * </pre> 799 * 800 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 801 */ setDimensionExpression( com.google.analytics.data.v1beta.DimensionExpression.Builder builderForValue)802 public Builder setDimensionExpression( 803 com.google.analytics.data.v1beta.DimensionExpression.Builder builderForValue) { 804 if (dimensionExpressionBuilder_ == null) { 805 dimensionExpression_ = builderForValue.build(); 806 } else { 807 dimensionExpressionBuilder_.setMessage(builderForValue.build()); 808 } 809 bitField0_ |= 0x00000002; 810 onChanged(); 811 return this; 812 } 813 /** 814 * 815 * 816 * <pre> 817 * One dimension can be the result of an expression of multiple dimensions. 818 * For example, dimension "country, city": concatenate(country, ", ", city). 819 * </pre> 820 * 821 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 822 */ mergeDimensionExpression( com.google.analytics.data.v1beta.DimensionExpression value)823 public Builder mergeDimensionExpression( 824 com.google.analytics.data.v1beta.DimensionExpression value) { 825 if (dimensionExpressionBuilder_ == null) { 826 if (((bitField0_ & 0x00000002) != 0) 827 && dimensionExpression_ != null 828 && dimensionExpression_ 829 != com.google.analytics.data.v1beta.DimensionExpression.getDefaultInstance()) { 830 getDimensionExpressionBuilder().mergeFrom(value); 831 } else { 832 dimensionExpression_ = value; 833 } 834 } else { 835 dimensionExpressionBuilder_.mergeFrom(value); 836 } 837 bitField0_ |= 0x00000002; 838 onChanged(); 839 return this; 840 } 841 /** 842 * 843 * 844 * <pre> 845 * One dimension can be the result of an expression of multiple dimensions. 846 * For example, dimension "country, city": concatenate(country, ", ", city). 847 * </pre> 848 * 849 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 850 */ clearDimensionExpression()851 public Builder clearDimensionExpression() { 852 bitField0_ = (bitField0_ & ~0x00000002); 853 dimensionExpression_ = null; 854 if (dimensionExpressionBuilder_ != null) { 855 dimensionExpressionBuilder_.dispose(); 856 dimensionExpressionBuilder_ = null; 857 } 858 onChanged(); 859 return this; 860 } 861 /** 862 * 863 * 864 * <pre> 865 * One dimension can be the result of an expression of multiple dimensions. 866 * For example, dimension "country, city": concatenate(country, ", ", city). 867 * </pre> 868 * 869 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 870 */ 871 public com.google.analytics.data.v1beta.DimensionExpression.Builder getDimensionExpressionBuilder()872 getDimensionExpressionBuilder() { 873 bitField0_ |= 0x00000002; 874 onChanged(); 875 return getDimensionExpressionFieldBuilder().getBuilder(); 876 } 877 /** 878 * 879 * 880 * <pre> 881 * One dimension can be the result of an expression of multiple dimensions. 882 * For example, dimension "country, city": concatenate(country, ", ", city). 883 * </pre> 884 * 885 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 886 */ 887 public com.google.analytics.data.v1beta.DimensionExpressionOrBuilder getDimensionExpressionOrBuilder()888 getDimensionExpressionOrBuilder() { 889 if (dimensionExpressionBuilder_ != null) { 890 return dimensionExpressionBuilder_.getMessageOrBuilder(); 891 } else { 892 return dimensionExpression_ == null 893 ? com.google.analytics.data.v1beta.DimensionExpression.getDefaultInstance() 894 : dimensionExpression_; 895 } 896 } 897 /** 898 * 899 * 900 * <pre> 901 * One dimension can be the result of an expression of multiple dimensions. 902 * For example, dimension "country, city": concatenate(country, ", ", city). 903 * </pre> 904 * 905 * <code>.google.analytics.data.v1beta.DimensionExpression dimension_expression = 2;</code> 906 */ 907 private com.google.protobuf.SingleFieldBuilderV3< 908 com.google.analytics.data.v1beta.DimensionExpression, 909 com.google.analytics.data.v1beta.DimensionExpression.Builder, 910 com.google.analytics.data.v1beta.DimensionExpressionOrBuilder> getDimensionExpressionFieldBuilder()911 getDimensionExpressionFieldBuilder() { 912 if (dimensionExpressionBuilder_ == null) { 913 dimensionExpressionBuilder_ = 914 new com.google.protobuf.SingleFieldBuilderV3< 915 com.google.analytics.data.v1beta.DimensionExpression, 916 com.google.analytics.data.v1beta.DimensionExpression.Builder, 917 com.google.analytics.data.v1beta.DimensionExpressionOrBuilder>( 918 getDimensionExpression(), getParentForChildren(), isClean()); 919 dimensionExpression_ = null; 920 } 921 return dimensionExpressionBuilder_; 922 } 923 924 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)925 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 926 return super.setUnknownFields(unknownFields); 927 } 928 929 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)930 public final Builder mergeUnknownFields( 931 final com.google.protobuf.UnknownFieldSet unknownFields) { 932 return super.mergeUnknownFields(unknownFields); 933 } 934 935 // @@protoc_insertion_point(builder_scope:google.analytics.data.v1beta.Dimension) 936 } 937 938 // @@protoc_insertion_point(class_scope:google.analytics.data.v1beta.Dimension) 939 private static final com.google.analytics.data.v1beta.Dimension DEFAULT_INSTANCE; 940 941 static { 942 DEFAULT_INSTANCE = new com.google.analytics.data.v1beta.Dimension(); 943 } 944 getDefaultInstance()945 public static com.google.analytics.data.v1beta.Dimension getDefaultInstance() { 946 return DEFAULT_INSTANCE; 947 } 948 949 private static final com.google.protobuf.Parser<Dimension> PARSER = 950 new com.google.protobuf.AbstractParser<Dimension>() { 951 @java.lang.Override 952 public Dimension parsePartialFrom( 953 com.google.protobuf.CodedInputStream input, 954 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 955 throws com.google.protobuf.InvalidProtocolBufferException { 956 Builder builder = newBuilder(); 957 try { 958 builder.mergeFrom(input, extensionRegistry); 959 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 960 throw e.setUnfinishedMessage(builder.buildPartial()); 961 } catch (com.google.protobuf.UninitializedMessageException e) { 962 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 963 } catch (java.io.IOException e) { 964 throw new com.google.protobuf.InvalidProtocolBufferException(e) 965 .setUnfinishedMessage(builder.buildPartial()); 966 } 967 return builder.buildPartial(); 968 } 969 }; 970 parser()971 public static com.google.protobuf.Parser<Dimension> parser() { 972 return PARSER; 973 } 974 975 @java.lang.Override getParserForType()976 public com.google.protobuf.Parser<Dimension> getParserForType() { 977 return PARSER; 978 } 979 980 @java.lang.Override getDefaultInstanceForType()981 public com.google.analytics.data.v1beta.Dimension getDefaultInstanceForType() { 982 return DEFAULT_INSTANCE; 983 } 984 } 985