Package com.fasterxml.jackson.databind.type

Examples of com.fasterxml.jackson.databind.type.MapType


   
    public void testMaps()
    {
        TypeFactory tf = TypeFactory.defaultInstance();
        JavaType t = tf.constructType(new TypeReference<LongValuedMap<String>>() { });
        MapType type = (MapType) t;
        assertSame(LongValuedMap.class, type.getRawClass());
        assertEquals(tf.constructType(String.class), type.getKeyType());
        assertEquals(tf.constructType(Long.class), type.getContentType());       
    }
View Full Code Here


        return new Source("Foo.java", "public class Foo { }");
    }
   
    private Map<String, Object> stringToJsonMap(final String content) throws Exception {
        ObjectMapper mapper = new ObjectMapper();
        MapType type = mapper.getTypeFactory().constructMapType(HashMap.class, String.class, Object.class);
        return mapper.readValue(content, type);
    }
View Full Code Here

    final Map<String, Object> parameters;

    if (jobParametersAsJsonMap != null && !jobParametersAsJsonMap.isEmpty()) {

      final MapType mapType = objectMapper.getTypeFactory().constructMapType(HashMap.class, String.class,
          String.class);

      try {
        parameters = new ObjectMapper().readValue(jobParametersAsJsonMap, mapType);
      }
View Full Code Here

    this.curator = curator;
    this.path = path;
    this.clusterId = clusterId;
    this.valueType = valueType;

    final MapType mapType = Json.typeFactory().constructMapType(HashMap.class,
                                                                Json.type(String.class), valueType);
    final Supplier<Map<String, T>> empty = Suppliers.ofInstance(Collections.<String, T>emptyMap());

    this.snapshot = PersistentAtomicReference.create(snapshotFile, mapType, empty);
    this.reactor = new DefaultReactor("zk-ppcc:" + path, new Update(), REFRESH_INTERVAL_MILLIS);
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.databind.type.MapType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.