public abstract class EntityProxy extends java.lang.Object implements Entity
The complete entity graph, traversed to its full extent, would
be incredibly large, thus, in practice, only a subset of this graph
is presented in the Response.
As a result, in some cases you may encounter associations whose nodes
are not available to you. When this occurs, an appropriate EntityProxy
instance is put into its place. To test if an entity is a proxy, use
the isProxy()
method.
Entity proxies satisfy the appropriate entity interface, returning null for all the values—acting as if the values were masked from you. The exception to this rule is the ID of the associated entity, which is always present on a proxy value.
To load an entity, call the load()
method. This method
will make a call to the remote service, fetching information for
the associated entity ID. To test if a value has been loaded, the
isLoaded()
method may be used.
isProxy()
,
isLoaded()
,
load()
,
Entity
Constructor and Description |
---|
EntityProxy(EntityId entityId,
Client client) |
Modifier and Type | Method and Description |
---|---|
java.util.List<Association> |
getAssociations()
A convenience method for getting the concatenation of
the association lists.
|
java.util.List<BusinessAssociation> |
getBusinessAssociations() |
java.util.List<Business> |
getBusinesses() |
java.util.List<Entity> |
getEntities()
A convenience method for getting the concatenation of
the entity lists.
|
EntityId |
getId() |
java.util.List<LocationAssociation> |
getLocationAssociations() |
java.util.List<Location> |
getLocations() |
java.lang.String |
getName()
A standardized method for getting the primary, human readable,
formatted String version of this entity.
|
java.util.List<Person> |
getPeople() |
java.util.List<PersonAssociation> |
getPersonAssociations() |
java.util.List<PhoneAssociation> |
getPhoneAssociations() |
java.util.List<Phone> |
getPhones() |
boolean |
isLoaded()
If the called on a proxy, return true only
if the backing entity has been fetched.
|
boolean |
isProxy()
Returns true if this entity instance is a proxy instance.
|
abstract void |
load()
Causes this instance to load its data by contacting
the remote service and requesting information.
|
public abstract void load() throws FindException
Entity
Causes this instance to load its data by contacting the remote service and requesting information. Once loaded, subsequent calls to this method have no effect.
This method is useful for proxy entities found at the edge of the graph.
load
in interface Entity
FindException
- If the lookup fails before it is able to generate a Response
object.Entity.isProxy()
,
Entity.isLoaded()
,
EntityProxy
public boolean isLoaded()
Entity
isLoaded
in interface Entity
Entity.isProxy()
,
Entity.load()
,
EntityProxy
public boolean isProxy()
Entity
isProxy
in interface Entity
Entity.isLoaded()
,
Entity.load()
,
EntityProxy
public java.lang.String getName()
Entity
public java.util.List<PersonAssociation> getPersonAssociations()
getPersonAssociations
in interface Entity
public java.util.List<BusinessAssociation> getBusinessAssociations()
getBusinessAssociations
in interface Entity
public java.util.List<LocationAssociation> getLocationAssociations()
getLocationAssociations
in interface Entity
public java.util.List<PhoneAssociation> getPhoneAssociations()
getPhoneAssociations
in interface Entity
public java.util.List<Association> getAssociations()
Entity
getAssociations
in interface Entity
public java.util.List<Business> getBusinesses()
getBusinesses
in interface Entity
public java.util.List<Location> getLocations()
getLocations
in interface Entity
public java.util.List<Entity> getEntities()
Entity
getEntities
in interface Entity