Android Open Source - RealtimeStorage-Android Key Schema






From Project

Back to project page RealtimeStorage-Android.

License

The source code is released under:

MIT License

If you think the Android project RealtimeStorage-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package co.realtime.storage.entities;
//from  ww  w. j  av a  2s  .  c  o  m
import java.util.HashMap;
import java.util.Map;

import co.realtime.storage.StorageRef.StorageDataType;

/**
 * Specification of the key schema meant for a table.
 * @author RTCS Development team
 *
 */
public class KeySchema implements IORMapping {
  private String name;
  private StorageDataType dataType;
  
  /**
   * Retrieves the name of the key.
   * @return 
   *     the type (Number or String) of the value stored in the key.
   */
  String getName() {
    return name;
  }
  
  /**
   * Assigns a name to the key.
   * @param name The name of the key.
   */
  void setName(String name) {
    this.name = name;
  }
  
  /**
   * Retrieves the type (Number or String) of the value stored in the key.
   * @return 
   *     the type (Number or String) of the value stored in the key.
   */  
  StorageDataType getDataType() {
    return dataType;
  }
  
  /**
   * Assigns the type (Number or String) of the value stored in the key.
   * @param dataType 
   *     Type of the key.
   */
  void setDataType(StorageDataType dataType) {
    this.dataType = dataType;
  }
  
  private KeySchema() {}
  
  /**
   * Builds a key schema.
   * @param name 
   *     Name of the key.
   * @param dataType 
   *     Type of the key.
   */
  public KeySchema(String name, StorageDataType dataType) {
    this.name = name;
    this.dataType = dataType;
  }
  
  public Map<String, Object> map() {
    Map<String, Object> throughputMap = new HashMap<String, Object>();
    throughputMap.put("name", getName());
    throughputMap.put("dataType", getDataType().name());  
    
    return throughputMap;
  }
}




Java Source Code List

adapters.TodoCustomAdapter.java
co.realtime.sample.ApplicationTest.java
co.realtime.sample.MainActivity.java
co.realtime.storage.ApplicationTest.java
co.realtime.storage.EventCollection.java
co.realtime.storage.Event.java
co.realtime.storage.Filter.java
co.realtime.storage.ItemAttribute.java
co.realtime.storage.ItemRef.java
co.realtime.storage.ItemSnapshot.java
co.realtime.storage.LHMItemsComparator.java
co.realtime.storage.OnRestCompleted.java
co.realtime.storage.PostBodyBuilder.java
co.realtime.storage.ProcessRestResponse.java
co.realtime.storage.RestWebservice.java
co.realtime.storage.Rest.java
co.realtime.storage.StorageContext.java
co.realtime.storage.StorageRef.java
co.realtime.storage.TableRef.java
co.realtime.storage.TableSnapshot.java
co.realtime.storage.entities.Heartbeat.java
co.realtime.storage.entities.IORMapping.java
co.realtime.storage.entities.KeySchema.java
co.realtime.storage.entities.Key.java
co.realtime.storage.entities.TableMetadata.java
co.realtime.storage.entities.Throughput.java
co.realtime.storage.ext.OnBooleanResponse.java
co.realtime.storage.ext.OnError.java
co.realtime.storage.ext.OnHeartbeat.java
co.realtime.storage.ext.OnItemSnapshot.java
co.realtime.storage.ext.OnPresence.java
co.realtime.storage.ext.OnReconnected.java
co.realtime.storage.ext.OnReconnecting.java
co.realtime.storage.ext.OnTableCreation.java
co.realtime.storage.ext.OnTableMetadata.java
co.realtime.storage.ext.OnTableSnapshot.java
co.realtime.storage.ext.OnTableUpdate.java
co.realtime.storage.ext.StorageException.java
config.Config.java
handlers.StorageHandler.java
helpers.ListNameHelper.java
listeners.ClickListener.java
listeners.EditorListener.java
ui.MyViewPager.java