Codota Logo
MapValuesStorage
Code IndexAdd Codota to your IDE (free)

How to use
MapValuesStorage
in
com.yahoo.squidb.data

Best Java code snippets using com.yahoo.squidb.data.MapValuesStorage (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: yahoo/squidb

/**
 * This method should construct a new ValuesStorage object for the model instance to use. By default, this object
 * will be a {@link MapValuesStorage}, but other implementations can be used for other platforms if appropriate
 * by overriding this method.
 */
protected ValuesStorage newValuesStorage() {
  return new MapValuesStorage();
}
origin: yahoo/squidb

/**
 * {@inheritDoc}
 */
@Override
public void putAll(ValuesStorage other) {
  if (other instanceof MapValuesStorage) {
    values.putAll(((MapValuesStorage) other).values);
  } else {
    Set<Map.Entry<String, Object>> valuesSet = other.valueSet();
    for (Map.Entry<String, Object> entry : valuesSet) {
      put(entry.getKey(), entry.getValue(), false);
    }
  }
}
origin: yahoo/squidb

/**
 * Analogous to {@link #readPropertiesFromMap(Map, Property[])} but adds the values to the model as set values,
 * i.e. marks the model as dirty with these values.
 */
public void setPropertiesFromMap(Map<String, Object> values, Property<?>... properties) {
  if (values == null) {
    return;
  }
  setPropertiesFromValuesStorage(new MapValuesStorage(values), properties);
}
origin: com.yahoo.squidb/squidb

/**
 * {@inheritDoc}
 */
@Override
public void putAll(ValuesStorage other) {
  if (other instanceof MapValuesStorage) {
    values.putAll(((MapValuesStorage) other).values);
  } else {
    Set<Map.Entry<String, Object>> valuesSet = other.valueSet();
    for (Map.Entry<String, Object> entry : valuesSet) {
      put(entry.getKey(), entry.getValue(), false);
    }
  }
}
origin: yahoo/squidb

/**
 * Copies values from the given Map. The values will be added to the model as read values (i.e. will not be
 * considered set values or mark the model as dirty).
 */
public void readPropertiesFromMap(Map<String, Object> values, Property<?>... properties) {
  if (values == null) {
    return;
  }
  readPropertiesFromValuesStorage(new MapValuesStorage(values), properties);
}
origin: yahoo/squidb

  @Override
  public void run() {
    TestModel model = new TestModel();
    List<String> list = Arrays.asList("A", "B", "C");
    model.setSomeList(list);
    ValuesStorage newStorage = new MapValuesStorage();
    newStorage.put(TestModel.SOME_LIST.getName(), "[\"D\", \"E\", \"F\"]");
    model.readPropertiesFromValuesStorage(newStorage, TestModel.SOME_LIST);
    assertEquals(Arrays.asList("D", "E", "F"), model.getSomeList());
    // Second call reads from cache; assert that works too
    assertTrue(model.hasTransitory(transitoryKeyForProperty(TestModel.SOME_LIST)));
    assertEquals(Arrays.asList("D", "E", "F"), model.getSomeList());
    newStorage.put(TestModel.SOME_LIST.getName(), "[\"H\", \"I\", \"J\"]");
    model.setPropertiesFromValuesStorage(newStorage, TestModel.SOME_LIST);
    int currentFromJSONCount = currentMapper.fromJSONCount;
    assertEquals(Arrays.asList("H", "I", "J"), model.getSomeList());
    assertEquals(currentFromJSONCount + 1, currentMapper.fromJSONCount);
    // Second call reads from cache; assert that works too
    assertTrue(model.hasTransitory(transitoryKeyForProperty(TestModel.SOME_LIST)));
    assertEquals(Arrays.asList("H", "I", "J"), model.getSomeList());
    assertEquals(currentFromJSONCount + 1, currentMapper.fromJSONCount);
  }
});
origin: com.yahoo.squidb/squidb

/**
 * This method should construct a new ValuesStorage object for the model instance to use. By default, this object
 * will be a {@link MapValuesStorage}, but other implementations can be used for other platforms if appropriate
 * by overriding this method.
 */
protected ValuesStorage newValuesStorage() {
  return new MapValuesStorage();
}
origin: com.yahoo.squidb/squidb

/**
 * Analogous to {@link #readPropertiesFromMap(Map, Property[])} but adds the values to the model as set values,
 * i.e. marks the model as dirty with these values.
 */
public void setPropertiesFromMap(Map<String, Object> values, Property<?>... properties) {
  if (values == null) {
    return;
  }
  setPropertiesFromValuesStorage(new MapValuesStorage(values), properties);
}
origin: com.yahoo.squidb/squidb

/**
 * Copies values from the given Map. The values will be added to the model as read values (i.e. will not be
 * considered set values or mark the model as dirty).
 */
public void readPropertiesFromMap(Map<String, Object> values, Property<?>... properties) {
  if (values == null) {
    return;
  }
  readPropertiesFromValuesStorage(new MapValuesStorage(values), properties);
}
com.yahoo.squidb.dataMapValuesStorage

Javadoc

Implementation of ValuesStorage that stores its values using a Map

Most used methods

  • <init>
  • put

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getSystemService (Context)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • String (java.lang)
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now