Skip navigation links

Oracle® On Track Communication SDK Documentation
Release 1(1.0)

E20955-01


waggle.core.info
Class XUpdater

java.lang.Object
  extended by waggle.core.info.XUpdater

Direct Known Subclasses:
XInfo

public class XUpdater
extends Object

This class represents the DTO for updating objects.

Only fields present in an Updater will be processed as possible changes to the target objects.


Constructor Summary
XUpdater()
          Create an empty XUpdater.
XUpdater(int size)
          Create an empty XUpdater, pre-allocating for an initial capacity of size.

 

Method Summary
 void addAll(XUpdater info)
          Add/Overwrite all entries in the specified XUpdater into this XUpdater.
 boolean contains(String name)
          Check if the XUpdater contains the specified field name.
 Set<Map.Entry<String,Object>> entrySet()
          Return a set of the entries in the XUpdater.
 boolean equals(Object object)
           
 Object[] getArray(String name)
          Get an object array value from the XUpdater.
 Boolean getBoolean(String name)
          Get a boolean value from the XUpdater.
 Boolean getBoolean(String name, Boolean dftValue)
          Get a boolean value from the XUpdater.
 byte[] getBytes(String name)
          Get a byte array value from the XUpdater.
 byte[] getBytes(String name, byte[] dftValue)
          Get a byte array value from the XUpdater.
<T> T
getCollection(T type, String name)
          Get a Collection value from the XUpdater.
 Collection<XObjectID> getCollectionObjectIDs(String name)
          Get a Collection value from the XUpdater.
 Collection<XUpdater> getCollectionUpdaters(String name)
          Get a Collection value from the XUpdater.
 Date getDate(String name)
          Get a date value from the XUpdater.
 Date getDate(String name, Date dftValue)
          Get a date value from the XUpdater.
 Double getDouble(String name)
          Get a double value from the XUpdater.
 Double getDouble(String name, Double dftValue)
          Get a double value from the XUpdater.
<T extends Enum<T>>
T
getEnum(String name, Class<T> enumClass)
          Get an enum value from the XUpdater.
<T extends Enum<T>>
T
getEnum(String name, Class<T> enumClass, T dftValue)
          Get an enum value from the XUpdater.
<T extends Enum<T>>
EnumSet<T>
getEnumSet(String name, Class<T> enumClass, EnumSet<T> dftValue)
          Get an EnumSet value from the XUpdater.
 Integer getInteger(String name)
          Get an integer value from the XUpdater.
 Integer getInteger(String name, Integer dftValue)
          Get an integer value from the XUpdater.
 Map<String,Object> getInternalMap()
          Allow access to internal map sometimes.
 List getList(String name)
          Get a List value from the XUpdater.
 Locale getLocale(String name)
          Return a Locale.
 Long getLong(String name)
          Get a long value from the XUpdater.
 Long getLong(String name, Long dftValue)
          Get a long value from the XUpdater.
 long[] getLongs(String name)
          Get a long array value from the XUpdater.
 long[] getLongs(String name, long[] dftValue)
          Get a long array value from the XUpdater.
<T> T
getMap(T type, String name)
          Get a Map value from the XUpdater.
 Object getObject(String name)
          Get an Object value from the XUpdater.
 XObjectID getObjectID(String name)
          Get an XObjectID value from the XUpdater.
 XSessionID getSessionID(String name)
          Get an XSessionID value from the XUpdater.
 String getString(String name)
          Get a string value from the XUpdater.
 String getString(String name, String dftValue)
          Get a string value from the XUpdater.
 TimeZone getTimeZone(String name)
          Return a TimeZone.
 XUpdater getUpdater(String name)
          Get an XUpdater value from the XUpdater.
 int hashCode()
           
 boolean isEmpty()
          Return true if the XUpdater is empty.
 Set<String> keySet()
          Return a set of the keys in the XUpdater.
 void put(String name, Boolean value)
          Put a Boolean value into the XUpdater.
 void put(String name, byte[] value)
          Put a byte array value into the XUpdater.
 void put(String name, Collection value)
          Put a Collection value into the XUpdater.
 void put(String name, Date value)
          Put a Date value into the XUpdater.
 void put(String name, Double value)
          Put a Double value into the XUpdater.
 void put(String name, Enum value)
          Put an enum value into the XUpdater.
 void put(String name, Float value)
          Put a Float value into the XUpdater.
 void put(String name, int[] value)
          Put an integer array value into the XUpdater.
 void put(String name, Integer value)
          Put an Integer value into the XUpdater.
 void put(String name, Long value)
          Put a Long value into the XUpdater.
 void put(String name, long[] value)
          Put a long array value into the XUpdater.
 void put(String name, Map value)
          Put a Map value into the XUpdater.
 void put(String name, Object value)
          Put an Object value into the XUpdater.
 void put(String name, String value)
          Put a String value into the XUpdater.
 void put(String name, XObjectID value)
          Put an XObjectID value into the XUpdater.
 void put(String name, XSessionID value)
          Put an XSessionID value into the XUpdater.
 void put(String name, XUpdater value)
          Put an XUpdater value into the XUpdater.
 Object remove(String name)
          Remove a value from the XUpdater.
 int size()
          Return the number of entries in the XUpdater.
 String toString()
           

 

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

XUpdater

public XUpdater()
Create an empty XUpdater.

XUpdater

public XUpdater(int size)
Create an empty XUpdater, pre-allocating for an initial capacity of size.
Parameters:
size - The number of entries expected in the XInfo.

Method Detail

contains

public boolean contains(String name)
Check if the XUpdater contains the specified field name.
Parameters:
name - The name of the XUpdater value to check for.
Returns:
Return true if the key specified by name exists in the XUpdater.

getString

public String getString(String name)
Get a string value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getString

public String getString(String name,
                        String dftValue)
Get a string value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getInteger

public Integer getInteger(String name)
Get an integer value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getInteger

public Integer getInteger(String name,
                          Integer dftValue)
Get an integer value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getLong

public Long getLong(String name)
Get a long value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getLong

public Long getLong(String name,
                    Long dftValue)
Get a long value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getDouble

public Double getDouble(String name)
Get a double value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getDouble

public Double getDouble(String name,
                        Double dftValue)
Get a double value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getBoolean

public Boolean getBoolean(String name)
Get a boolean value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getBoolean

public Boolean getBoolean(String name,
                          Boolean dftValue)
Get a boolean value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getDate

public Date getDate(String name)
Get a date value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getDate

public Date getDate(String name,
                    Date dftValue)
Get a date value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getLongs

public long[] getLongs(String name)
Get a long array value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getLongs

public long[] getLongs(String name,
                       long[] dftValue)
Get a long array value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getBytes

public byte[] getBytes(String name)
Get a byte array value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getBytes

public byte[] getBytes(String name,
                       byte[] dftValue)
Get a byte array value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getObjectID

public XObjectID getObjectID(String name)
Get an XObjectID value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getSessionID

public XSessionID getSessionID(String name)
Get an XSessionID value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getEnum

public <T extends Enum<T>> T getEnum(String name,
                                     Class<T> enumClass)
Get an enum value from the XUpdater.
Type Parameters:
T - The type of enum to be returned.
Parameters:
name - The name of the XUpdater value to return.
enumClass - The class of the XUpdater enum value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getEnum

public <T extends Enum<T>> T getEnum(String name,
                                     Class<T> enumClass,
                                     T dftValue)
Get an enum value from the XUpdater.
Type Parameters:
T - The type of enum to be returned.
Parameters:
name - The name of the XUpdater value to return.
enumClass - The class of the XUpdater enum value to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getEnumSet

public <T extends Enum<T>> EnumSet<T> getEnumSet(String name,
                                                 Class<T> enumClass,
                                                 EnumSet<T> dftValue)
Get an EnumSet value from the XUpdater.
Type Parameters:
T - The type of enum entries to be returned in the EnumSet.
Parameters:
name - The name of the XUpdater value to return.
enumClass - The class of the XUpdater enum values to return.
dftValue - The value to return if name is not present.
Returns:
The value corresponding to name, if present; otherwise dftValue.

getMap

public <T> T getMap(T type,
                    String name)
Get a Map value from the XUpdater.
Type Parameters:
T - The type of object in the Map.
Parameters:
type - The type object (may be null).
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getCollection

public <T> T getCollection(T type,
                           String name)
Get a Collection value from the XUpdater. This method has semantics similar to XClass.uncheckedCast().
Type Parameters:
T - The type of object in the Collection.
Parameters:
type - The type object (may be null).
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getCollectionUpdaters

public Collection<XUpdater> getCollectionUpdaters(String name)
Get a Collection value from the XUpdater. This method has semantics similar to XClass.uncheckedCast().
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getCollectionObjectIDs

public Collection<XObjectID> getCollectionObjectIDs(String name)
Get a Collection value from the XUpdater. This method has semantics similar to XClass.uncheckedCast().
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getList

public List getList(String name)
Get a List value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getArray

public Object[] getArray(String name)
Get an object array value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getUpdater

public XUpdater getUpdater(String name)
Get an XUpdater value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

getTimeZone

public TimeZone getTimeZone(String name)
Return a TimeZone.
Parameters:
name - The field name.
Returns:
The Timezone or null.

getLocale

public Locale getLocale(String name)
Return a Locale.
Parameters:
name - The field name.
Returns:
The Locale or null.

getObject

public Object getObject(String name)
Get an Object value from the XUpdater.
Parameters:
name - The name of the XUpdater value to return.
Returns:
The value corresponding to name, if present; otherwise null.

put

public void put(String name,
                String value)
Put a String value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Integer value)
Put an Integer value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Long value)
Put a Long value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Date value)
Put a Date value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Boolean value)
Put a Boolean value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Collection value)
Put a Collection value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Map value)
Put a Map value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                XUpdater value)
Put an XUpdater value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                byte[] value)
Put a byte array value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                int[] value)
Put an integer array value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                long[] value)
Put a long array value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                XObjectID value)
Put an XObjectID value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                XSessionID value)
Put an XSessionID value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Enum value)
Put an enum value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Float value)
Put a Float value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Double value)
Put a Double value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

put

public void put(String name,
                Object value)
Put an Object value into the XUpdater.
Parameters:
name - The name of the XUpdater entry.
value - The value of the XUpdater entry corresponding to name.

remove

public Object remove(String name)
Remove a value from the XUpdater.
Parameters:
name - The name of the value to remove.
Returns:
The old value if there was one.

entrySet

public Set<Map.Entry<String,Object>> entrySet()
Return a set of the entries in the XUpdater.
Returns:
a Set of the entries in the XUpdater.

keySet

public Set<String> keySet()
Return a set of the keys in the XUpdater.
Returns:
a Set of the keys in the XUpdater.

size

public int size()
Return the number of entries in the XUpdater.
Returns:
the number of entries in the XUpdater.

addAll

public void addAll(XUpdater info)
Add/Overwrite all entries in the specified XUpdater into this XUpdater.
Parameters:
info - The XUpdater to add to this XUpdater.

isEmpty

public boolean isEmpty()
Return true if the XUpdater is empty.
Returns:
true if the XUpdater is empty, otherwise false.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

getInternalMap

public Map<String,Object> getInternalMap()
Allow access to internal map sometimes. Be careful, no updates.
Returns:
The internal map.

Skip navigation links

Oracle® On Track Communication SDK Documentation
Release 1(1.0)

E20955-01


Copyright © 2011, Oracle and/or its affiliates. All rights reserved.