Examples of typesafeToProperties()


Examples of com.vercer.engine.persist.PropertyTranslator.typesafeToProperties()

    keyCache.cacheKeyReferenceForInstance(instance, encodeKeySpec.toObjectReference());
     
    // translate fields to properties - sets parent and id on key
    PropertyTranslator encoder = encoder(instance);
    Set<Property> properties = encoder.typesafeToProperties(instance, Path.EMPTY_PATH, indexed);
    if (properties == null)
    {
      throw new IllegalStateException("Could not translate instance: " + instance);
    }
View Full Code Here

Examples of com.vercer.engine.persist.PropertyTranslator.typesafeToProperties()

          value = converters.convert(value, type);

          Path childPath = new Path.Builder(path).field(fieldToPartName(field)).build();

          PropertyTranslator translator = encoder(field, value);
          Set<Property> properties = translator.typesafeToProperties(value, childPath, indexed(field));
          if (properties == null)
          {
            throw new IllegalStateException("Could not translate value to properties: " + value);
          }
          merged.addAll(properties);
View Full Code Here

Examples of com.vercer.engine.persist.translator.ListTranslator.typesafeToProperties()

  {
    // create dummy translator that always returns a single property containing the instance
    PropertyTranslator chained = new DirectTranslator();

    ListTranslator translator = new ListTranslator(chained);
    Set<Property> encoded = translator.typesafeToProperties(values, Path.EMPTY_PATH, true);

    // should be a single property with a list of values
    assertEquals(1, encoded.size());

    Field field = getClass().getDeclaredField("values");
View Full Code Here

Examples of com.vercer.engine.persist.translator.ListTranslator.typesafeToProperties()

        return properties.iterator().next().getValue();
      }
    };

    ListTranslator translator = new ListTranslator(chained);
    Set<Property> encoded = translator.typesafeToProperties(values, Path.EMPTY_PATH, true);

    assertEquals(2, encoded.size());
    assertEquals(3, ((List<?>) encoded.iterator().next().getValue()).size());
    assertEquals(1, encoded.iterator().next().getPath().getParts().size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.