Package org.intermine.objectstore.proxy
Class ProxyReference
- java.lang.Object
-
- org.intermine.objectstore.proxy.ProxyReference
-
- All Implemented Interfaces:
FastPathObject,InterMineFastPathObject,InterMineObject,Lazy
public class ProxyReference extends java.lang.Object implements InterMineObject, Lazy
Class which holds a reference to an object in the database- Author:
- Matthew Wakeling
-
-
Constructor Summary
Constructors Constructor Description ProxyReference(ObjectStore os, java.lang.Integer id, java.lang.Class<? extends InterMineObject> clazz)Construct a ProxyReference object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends FastPathObject>getElementType(java.lang.String fieldName)Returns the element type of a collection by name.java.lang.ObjectgetFieldProxy(java.lang.String fieldName)Returns the value of a field without dereferencing any ProxyReference objects.java.lang.Class<?>getFieldType(java.lang.String fieldName)Returns the type of a field by name.java.lang.ObjectgetFieldValue(java.lang.String fieldName)Returns the value of a field by name.java.lang.IntegergetId()Gets the ID valueStringConstructorgetoBJECT()Returns the NotXml serialised version of this object.InterMineObjectgetObject()Gets the real object from the database.ObjectStoregetObjectStore()Returns the ObjectStore that this proxy will usevoidsetFieldValue(java.lang.String fieldName, java.lang.Object value)Sets the value of a field by name.voidsetId(java.lang.Integer id)Sets the ID valuevoidsetoBJECT(java.lang.String[] notXml, ObjectStore os)Sets the values of the fields to the values in the given split NotXml.voidsetoBJECT(java.lang.String notXml, ObjectStore os)Sets the values of the fields to the values in the given NotXml.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ProxyReference
public ProxyReference(ObjectStore os, java.lang.Integer id, java.lang.Class<? extends InterMineObject> clazz)
Construct a ProxyReference object.- Parameters:
os- the ObjectStore to retrieve the object fromid- the internal id of the real objectclazz- a hint of the class that this object is - use InterMineObject if unsure
-
-
Method Detail
-
getObject
public InterMineObject getObject()
Gets the real object from the database.- Returns:
- a InterMineObject
-
getId
public java.lang.Integer getId()
Gets the ID value- Specified by:
getIdin interfaceInterMineFastPathObject- Specified by:
getIdin interfaceInterMineObject- Returns:
- the id
-
setId
public void setId(java.lang.Integer id)
Sets the ID value- Specified by:
setIdin interfaceInterMineFastPathObject- Specified by:
setIdin interfaceInterMineObject- Parameters:
id- the id
-
getObjectStore
public ObjectStore getObjectStore()
Returns the ObjectStore that this proxy will use- Specified by:
getObjectStorein interfaceLazy- Returns:
- an ObjectStore
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getoBJECT
public StringConstructor getoBJECT()
Returns the NotXml serialised version of this object.- Specified by:
getoBJECTin interfaceInterMineFastPathObject- Specified by:
getoBJECTin interfaceInterMineObject- Returns:
- a StringConstructor containing the NotXml
-
setoBJECT
public void setoBJECT(java.lang.String notXml, ObjectStore os)Sets the values of the fields to the values in the given NotXml.- Specified by:
setoBJECTin interfaceInterMineObject- Parameters:
notXml- a String containing NotXml for this classos- an ObjectStore from which to create proxies
-
setoBJECT
public void setoBJECT(java.lang.String[] notXml, ObjectStore os)Sets the values of the fields to the values in the given split NotXml.- Specified by:
setoBJECTin interfaceInterMineObject- Parameters:
notXml- a String array containing the NotXml split with the delimiteros- an ObjectStore from which to create proxies
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.String fieldName)
Returns the value of a field by name.- Specified by:
getFieldValuein interfaceFastPathObject- Parameters:
fieldName- the name of the field- Returns:
- the value of the field
-
getFieldProxy
public java.lang.Object getFieldProxy(java.lang.String fieldName)
Returns the value of a field without dereferencing any ProxyReference objects.- Specified by:
getFieldProxyin interfaceFastPathObject- Parameters:
fieldName- the name of the field- Returns:
- the value of the field, or a ProxyReference representing it
-
setFieldValue
public void setFieldValue(java.lang.String fieldName, java.lang.Object value)Sets the value of a field by name.- Specified by:
setFieldValuein interfaceFastPathObject- Parameters:
fieldName- the name of the fieldvalue- the value of the field, or a ProxyReference representing it
-
getFieldType
public java.lang.Class<?> getFieldType(java.lang.String fieldName)
Returns the type of a field by name.- Specified by:
getFieldTypein interfaceFastPathObject- Parameters:
fieldName- the name of the field- Returns:
- the type of the field
-
getElementType
public java.lang.Class<? extends FastPathObject> getElementType(java.lang.String fieldName)
Returns the element type of a collection by name.- Specified by:
getElementTypein interfaceInterMineFastPathObject- Specified by:
getElementTypein interfaceInterMineObject- Parameters:
fieldName- the name of the collection- Returns:
- the type of the elements of the collection
-
-