public static <E> ThriftType set(ThriftType valueType) { Preconditions.checkNotNull(valueType, "valueType is null"); return set(new DefaultThriftTypeReference(valueType)); }
@Test public void testCollectionThriftTypes() throws Exception { testRoundTripSerialize(set(STRING), ImmutableSet.of("some string", "another string")); testRoundTripSerialize(list(STRING), ImmutableList.of("some string", "another string")); testRoundTripSerialize(map(STRING, STRING), ImmutableMap.of("1", "one", "2", "two")); }
return set(getThriftType(elementType));
return set(getCollectionElementThriftTypeReference(elementType));
@Test public void testCoercedCollection() throws Exception { testRoundTripSerialize(set(I32.coerceTo(Integer.class)), ImmutableSet.of(1, 2, 3)); testRoundTripSerialize(list(I32.coerceTo(Integer.class)), ImmutableList.of(4, 5, 6)); testRoundTripSerialize(map(I32.coerceTo(Integer.class), I32.coerceTo(Integer.class)), ImmutableMap.of(1, 2, 2, 4, 3, 9)); }