|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
| 3 | + * in compliance with the License. You may obtain a copy of the License at |
| 4 | + * |
| 5 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under the License |
| 8 | + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 9 | + * or implied. See the License for the specific language governing permissions and limitations under |
| 10 | + * the License. |
| 11 | + */ |
| 12 | +/* |
| 13 | + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ |
| 14 | + * Modify at your own risk. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.google.api.services.adsenseplatform.v1alpha.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * A representation of a decimal value, such as 2.5. Clients may convert values into language-native |
| 21 | + * decimal formats, such as Java's [BigDecimal](https://docs.oracle.com/en/java/javase/11/docs/api/j |
| 22 | + * ava.base/java/math/BigDecimal.html) or Python's |
| 23 | + * [decimal.Decimal](https://docs.python.org/3/library/decimal.html). |
| 24 | + * |
| 25 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 26 | + * transmitted over HTTP when working with the AdSense Platform API. For a detailed explanation see: |
| 27 | + * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> |
| 28 | + * </p> |
| 29 | + * |
| 30 | + * @author Google, Inc. |
| 31 | + */ |
| 32 | +@SuppressWarnings("javadoc") |
| 33 | +public final class Decimal extends com.google.api.client.json.GenericJson { |
| 34 | + |
| 35 | + /** |
| 36 | + * The decimal value, as a string. The string representation consists of an optional sign, `+` |
| 37 | + * (`U+002B`) or `-` (`U+002D`), followed by a sequence of zero or more decimal digits ("the |
| 38 | + * integer"), optionally followed by a fraction, optionally followed by an exponent. An empty |
| 39 | + * string **should** be interpreted as `0`. The fraction consists of a decimal point followed by |
| 40 | + * zero or more decimal digits. The string must contain at least one digit in either the integer |
| 41 | + * or the fraction. The number formed by the sign, the integer and the fraction is referred to as |
| 42 | + * the significand. The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`) |
| 43 | + * followed by one or more decimal digits. Services **should** normalize decimal values before |
| 44 | + * storing them by: - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`). - Replacing a |
| 45 | + * zero-length integer value with `0` (`.5` -> `0.5`). - Coercing the exponent character to upper- |
| 46 | + * case, with explicit sign (`2.5e8` -> `2.5E+8`). - Removing an explicitly-provided zero exponent |
| 47 | + * (`2.5E0` -> `2.5`). Services **may** perform additional normalization based on its own needs |
| 48 | + * and the internal decimal implementation selected, such as shifting the decimal point and |
| 49 | + * exponent value together (example: `2.5E-1` <-> `0.25`). Additionally, services **may** preserve |
| 50 | + * trailing zeroes in the fraction to indicate increased precision, but are not required to do so. |
| 51 | + * Note that only the `.` character is supported to divide the integer and the fraction; `,` |
| 52 | + * **should not** be supported regardless of locale. Additionally, thousand separators **should |
| 53 | + * not** be supported. If a service does support them, values **must** be normalized. The ENBF |
| 54 | + * grammar is: DecimalString = '' | [Sign] Significand [Exponent]; Sign = '+' | '-'; Significand = |
| 55 | + * Digits '.' | [Digits] '.' Digits; Exponent = ('e' | 'E') [Sign] Digits; Digits = { '0' | '1' | |
| 56 | + * '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' }; Services **should** clearly document the range |
| 57 | + * of supported values, the maximum supported precision (total number of digits), and, if |
| 58 | + * applicable, the scale (number of digits after the decimal point), as well as how it behaves |
| 59 | + * when receiving out-of-bounds values. Services **may** choose to accept values passed as input |
| 60 | + * even when the value has a higher precision or scale than the service supports, and **should** |
| 61 | + * round the value to fit the supported scale. Alternatively, the service **may** error with `400 |
| 62 | + * Bad Request` (`INVALID_ARGUMENT` in gRPC) if precision would be lost. Services **should** error |
| 63 | + * with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) if the service receives a value outside of |
| 64 | + * the supported range. |
| 65 | + * The value may be {@code null}. |
| 66 | + */ |
| 67 | + @com.google.api.client.util.Key |
| 68 | + private java.lang.String value; |
| 69 | + |
| 70 | + /** |
| 71 | + * The decimal value, as a string. The string representation consists of an optional sign, `+` |
| 72 | + * (`U+002B`) or `-` (`U+002D`), followed by a sequence of zero or more decimal digits ("the |
| 73 | + * integer"), optionally followed by a fraction, optionally followed by an exponent. An empty |
| 74 | + * string **should** be interpreted as `0`. The fraction consists of a decimal point followed by |
| 75 | + * zero or more decimal digits. The string must contain at least one digit in either the integer |
| 76 | + * or the fraction. The number formed by the sign, the integer and the fraction is referred to as |
| 77 | + * the significand. The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`) |
| 78 | + * followed by one or more decimal digits. Services **should** normalize decimal values before |
| 79 | + * storing them by: - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`). - Replacing a |
| 80 | + * zero-length integer value with `0` (`.5` -> `0.5`). - Coercing the exponent character to upper- |
| 81 | + * case, with explicit sign (`2.5e8` -> `2.5E+8`). - Removing an explicitly-provided zero exponent |
| 82 | + * (`2.5E0` -> `2.5`). Services **may** perform additional normalization based on its own needs |
| 83 | + * and the internal decimal implementation selected, such as shifting the decimal point and |
| 84 | + * exponent value together (example: `2.5E-1` <-> `0.25`). Additionally, services **may** preserve |
| 85 | + * trailing zeroes in the fraction to indicate increased precision, but are not required to do so. |
| 86 | + * Note that only the `.` character is supported to divide the integer and the fraction; `,` |
| 87 | + * **should not** be supported regardless of locale. Additionally, thousand separators **should |
| 88 | + * not** be supported. If a service does support them, values **must** be normalized. The ENBF |
| 89 | + * grammar is: DecimalString = '' | [Sign] Significand [Exponent]; Sign = '+' | '-'; Significand = |
| 90 | + * Digits '.' | [Digits] '.' Digits; Exponent = ('e' | 'E') [Sign] Digits; Digits = { '0' | '1' | |
| 91 | + * '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' }; Services **should** clearly document the range |
| 92 | + * of supported values, the maximum supported precision (total number of digits), and, if |
| 93 | + * applicable, the scale (number of digits after the decimal point), as well as how it behaves |
| 94 | + * when receiving out-of-bounds values. Services **may** choose to accept values passed as input |
| 95 | + * even when the value has a higher precision or scale than the service supports, and **should** |
| 96 | + * round the value to fit the supported scale. Alternatively, the service **may** error with `400 |
| 97 | + * Bad Request` (`INVALID_ARGUMENT` in gRPC) if precision would be lost. Services **should** error |
| 98 | + * with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) if the service receives a value outside of |
| 99 | + * the supported range. |
| 100 | + * @return value or {@code null} for none |
| 101 | + */ |
| 102 | + public java.lang.String getValue() { |
| 103 | + return value; |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * The decimal value, as a string. The string representation consists of an optional sign, `+` |
| 108 | + * (`U+002B`) or `-` (`U+002D`), followed by a sequence of zero or more decimal digits ("the |
| 109 | + * integer"), optionally followed by a fraction, optionally followed by an exponent. An empty |
| 110 | + * string **should** be interpreted as `0`. The fraction consists of a decimal point followed by |
| 111 | + * zero or more decimal digits. The string must contain at least one digit in either the integer |
| 112 | + * or the fraction. The number formed by the sign, the integer and the fraction is referred to as |
| 113 | + * the significand. The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`) |
| 114 | + * followed by one or more decimal digits. Services **should** normalize decimal values before |
| 115 | + * storing them by: - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`). - Replacing a |
| 116 | + * zero-length integer value with `0` (`.5` -> `0.5`). - Coercing the exponent character to upper- |
| 117 | + * case, with explicit sign (`2.5e8` -> `2.5E+8`). - Removing an explicitly-provided zero exponent |
| 118 | + * (`2.5E0` -> `2.5`). Services **may** perform additional normalization based on its own needs |
| 119 | + * and the internal decimal implementation selected, such as shifting the decimal point and |
| 120 | + * exponent value together (example: `2.5E-1` <-> `0.25`). Additionally, services **may** preserve |
| 121 | + * trailing zeroes in the fraction to indicate increased precision, but are not required to do so. |
| 122 | + * Note that only the `.` character is supported to divide the integer and the fraction; `,` |
| 123 | + * **should not** be supported regardless of locale. Additionally, thousand separators **should |
| 124 | + * not** be supported. If a service does support them, values **must** be normalized. The ENBF |
| 125 | + * grammar is: DecimalString = '' | [Sign] Significand [Exponent]; Sign = '+' | '-'; Significand = |
| 126 | + * Digits '.' | [Digits] '.' Digits; Exponent = ('e' | 'E') [Sign] Digits; Digits = { '0' | '1' | |
| 127 | + * '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' }; Services **should** clearly document the range |
| 128 | + * of supported values, the maximum supported precision (total number of digits), and, if |
| 129 | + * applicable, the scale (number of digits after the decimal point), as well as how it behaves |
| 130 | + * when receiving out-of-bounds values. Services **may** choose to accept values passed as input |
| 131 | + * even when the value has a higher precision or scale than the service supports, and **should** |
| 132 | + * round the value to fit the supported scale. Alternatively, the service **may** error with `400 |
| 133 | + * Bad Request` (`INVALID_ARGUMENT` in gRPC) if precision would be lost. Services **should** error |
| 134 | + * with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) if the service receives a value outside of |
| 135 | + * the supported range. |
| 136 | + * @param value value or {@code null} for none |
| 137 | + */ |
| 138 | + public Decimal setValue(java.lang.String value) { |
| 139 | + this.value = value; |
| 140 | + return this; |
| 141 | + } |
| 142 | + |
| 143 | + @Override |
| 144 | + public Decimal set(String fieldName, Object value) { |
| 145 | + return (Decimal) super.set(fieldName, value); |
| 146 | + } |
| 147 | + |
| 148 | + @Override |
| 149 | + public Decimal clone() { |
| 150 | + return (Decimal) super.clone(); |
| 151 | + } |
| 152 | + |
| 153 | +} |
0 commit comments