Java Code Examples for com.google.common.primitives.Booleans#asList()
The following examples show how to use
com.google.common.primitives.Booleans#asList() .
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: TensorUtil.java From jpmml-tensorflow with GNU Affero General Public License v3.0 | 7 votes |
static public List<?> getValues(Tensor tensor){ DataType dataType = tensor.dataType(); switch(dataType){ case FLOAT: return Floats.asList(TensorUtil.toFloatArray(tensor)); case DOUBLE: return Doubles.asList(TensorUtil.toDoubleArray(tensor)); case INT32: return Ints.asList(TensorUtil.toIntArray(tensor)); case INT64: return Longs.asList(TensorUtil.toLongArray(tensor)); case STRING: return Arrays.asList(TensorUtil.toStringArray(tensor)); case BOOL: return Booleans.asList(TensorUtil.toBooleanArray(tensor)); default: throw new IllegalArgumentException(); } }
Example 2
Source File: TestApproximateCountDistinctBoolean.java From presto with Apache License 2.0 | 4 votes |
@Test(dataProvider = "inputSequences") public void testNonEmptyInputs(boolean... inputSequence) { List<Boolean> values = Booleans.asList(inputSequence); assertCount(values, 0, distinctCount(values)); }
Example 3
Source File: BooleansExample.java From levelup-java-examples with Apache License 2.0 | 3 votes |
@Test public void convert_boolean_array_to_Boolean_list () { boolean[] booleanArray = {true, false, true, false}; List<Boolean> booleans = Booleans.asList(booleanArray); assertEquals(4, booleans.size()); }