Android Open Source - RealtimeStorage-Android Key






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. ja  va  2 s  .  com
import java.util.HashMap;
import java.util.Map;

/**
 * Specification of the key structure of a table.
 * @author RTCS Development team
 *
 */
public class Key implements IORMapping {
  private KeySchema primaryKey;
  private KeySchema secondaryKey;
  
  /**
   * Builds a key structure with a primary key.
   * @param primaryKey 
   *     The primary key schema.
   */
  public Key(KeySchema primaryKey) {
    this.primaryKey = primaryKey;
  }
  
  /**
   * Builds a key structure with primary and secondary keys.
   * @param 
   *     primaryKey The primary key schema.
   * @param 
   *     secondaryKey The secondary key schema.
   */  
  public Key(KeySchema primaryKey, KeySchema secondaryKey) {
    this.primaryKey = primaryKey;
    this.secondaryKey = secondaryKey;
  }

  /**
   * Retrieves the primary key schema.
   * @return 
   *     primary key schema.
   */
  KeySchema getPrimaryKey() {
    return primaryKey;
  }

  /**
   * Assigns the primary key schema.
   * @param primaryKey 
   *     The primary key schema.
   */
  void setPrimaryKey(KeySchema primaryKey) {
    this.primaryKey = primaryKey;
  }
  
  /**
   * Retrieves the secondary key schema.
   * @return 
   *     secondary key schema.
   */
  KeySchema getSecondaryKey() {
    return secondaryKey;
  }

  /**
   * Assigns the secondary key schema.
   * @param secondary 
   *     The secondary key schema.
   */
  void setSecondaryKey(KeySchema secondaryKey) {
    this.secondaryKey = secondaryKey;
  }
  
  public Map<String, Object> map() {
    Map<String, Object> throughputMap = new HashMap<String, Object>();
    throughputMap.put("primary", getPrimaryKey().map());
    
    if(getSecondaryKey() != null)
      throughputMap.put("secondary", getSecondaryKey().map());  
    
    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