Lines Matching refs:value

65      * Adds an enum tag with the provided value.
69 public void addEnum(int tag, int value) {
74 addEnumTag(tag, value);
86 for (int value : values) {
87 addEnumTag(tag, value);
92 * Returns the value of the specified enum tag or {@code defaultValue} if the tag is not
126 private void addEnumTag(int tag, int value) {
127 mArguments.add(new KeymasterIntArgument(tag, value));
131 return ((KeymasterIntArgument) arg).value;
135 * Adds an unsigned 32-bit int tag with the provided value.
138 * {@code value} is outside of the permitted range [0; 2^32).
140 public void addUnsignedInt(int tag, long value) {
146 if ((value < 0) || (value > UINT32_MAX_VALUE)) {
147 throw new IllegalArgumentException("Int tag value out of range: " + value);
149 mArguments.add(new KeymasterIntArgument(tag, (int) value));
153 * Returns the value of the specified unsigned 32-bit int tag or {@code defaultValue} if the tag
167 return ((KeymasterIntArgument) arg).value & 0xffffffffL;
171 * Adds an unsigned 64-bit long tag with the provided value.
174 * {@code value} is outside of the permitted range [0; 2^64).
176 public void addUnsignedLong(int tag, BigInteger value) {
181 addLongTag(tag, value);
202 private void addLongTag(int tag, BigInteger value) {
204 if ((value.signum() == -1) || (value.compareTo(UINT64_MAX_VALUE) > 0)) {
205 throw new IllegalArgumentException("Long tag value out of range: " + value);
207 mArguments.add(new KeymasterLongArgument(tag, value.longValue()));
213 return toUint64(((KeymasterLongArgument) arg).value);
246 * Adds a bytes tag with the provided value.
250 public void addBytes(int tag, byte[] value) {
254 if (value == null) {
255 throw new NullPointerException("value == nulll");
257 mArguments.add(new KeymasterBlobArgument(tag, value));
261 * Returns the value of the specified bytes tag or {@code defaultValue} if the tag is not
278 * Adds a date tag with the provided value.
280 * @throws IllegalArgumentException if {@code tag} is not a date tag or if {@code value} is
283 public void addDate(int tag, Date value) {
287 if (value == null) {
288 throw new NullPointerException("value == nulll");
292 if (value.getTime() < 0) {
293 throw new IllegalArgumentException("Date tag value out of range: " + value);
295 mArguments.add(new KeymasterDateArgument(tag, value));
299 * Adds a date tag with the provided value, if the value is not {@code null}. Does nothing if
300 * the {@code value} is null.
302 * @throws IllegalArgumentException if {@code tag} is not a date tag or if {@code value} is
305 public void addDateIfNotNull(int tag, Date value) {
309 if (value != null) {
310 addDate(tag, value);
315 * Returns the value of the specified date tag or {@code defaultValue} if the tag is not
318 * @throws IllegalArgumentException if {@code tag} is not a date tag or if the tag's value
334 throw new IllegalArgumentException("Tag value too large. Tag: " + tag);
371 * Converts the provided value to non-negative {@link BigInteger}, treating the sign bit of the
372 * provided value as the most significant bit of the result.
374 public static BigInteger toUint64(long value) {
375 if (value >= 0) {
376 return BigInteger.valueOf(value);
378 return BigInteger.valueOf(value).add(UINT64_RANGE);