public class Reference extends ObjectPrinter
| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<Reference> |
_context
Provides the context to the unique identity of this asset.
|
protected String |
_id
The '_id' property defines the unique Repository ID (RID) of the asset.
|
protected String |
_name
The '_name' property of a Reference is equivalent to its 'name' property, but will always be
populated on a reference ('name' may not yet be populated, depending on whether you have only a reference
to the asset, or the full asset itself).
|
protected String |
_type
The '_type' property defines the type of asset this Reference represents.
|
protected String |
_url
The '_url' property provides a navigable link directly to the full details of asset this Reference represents,
within a given IGC environment.
|
| Constructor and Description |
|---|
Reference() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canAssetBeCreatedFromPOJO(Class pojoClass)
Indicates whether assets of this type can be created via IGC's API (true) or not (false).
|
static List<String> |
getAllPropertiesFromPOJO(Class pojoClass)
Retrieves the list of all property names for the asset.
|
Reference |
getAssetDetails(IGCRestClient igcrest)
Retrieve the asset details from a minimal reference stub.
|
static String |
getAssetTypeForSearch(String assetType)
Translates the type of asset into what should be used for searching.
|
static String |
getAssetTypeFromPOJO(Class pojoClass)
Retrieves the asset type from the provided POJO.
|
Reference |
getAssetWithSubsetOfProperties(IGCRestClient igcrest,
String[] properties)
This will generally be the most performant method by which to retrieve asset information, when only
some subset of properties is required
|
Reference |
getAssetWithSubsetOfProperties(IGCRestClient igcrest,
String[] properties,
int pageSize)
This will generally be the most performant method by which to retrieve asset information, when only
some subset of properties is required
|
Reference |
getAssetWithSubsetOfProperties(IGCRestClient igcrest,
String[] properties,
int pageSize,
IGCSearchSorting sorting)
This will generally be the most performant method by which to retrieve asset information, when only
some subset of properties is required
|
ArrayList<Reference> |
getContext() |
static String |
getDisplayNameFromPOJO(Class pojoClass)
Retrieves the IGC asset display name from the provided POJO.
|
Field |
getFieldByName(String name)
Retrieves the first Field, from anywhere within the class hierarchy (bottom-up), by its name.
|
Reference |
getFullAssetDetails(IGCRestClient igcrest)
Retrieve all of the asset details, including all relationships, from a minimal reference stub.
|
String |
getId() |
Identity |
getIdentity(IGCRestClient igcrest)
Retrieves the semantic identity of the asset.
|
String |
getName() |
static List<String> |
getNonRelationshipProperties() |
static List<String> |
getNonRelationshipPropertiesFromPOJO(Class pojoClass)
Retrieves the list of property names for the asset that are not relationships to other assets.
|
static List<String> |
getPagedRelationalPropertiesFromPOJO(Class pojoClass)
Retrieves the list of all paged relationship property names for the asset.
|
Object |
getPropertyByName(String name)
Retrieves the value of a property of this asset by the provided name (allows dynamic retrieval of properties).
|
static List<String> |
getStringPropertiesFromPOJO(Class pojoClass)
Retrieves the list of property names for the asset that are string-valued.
|
String |
getType() |
String |
getUrl() |
boolean |
hasModificationDetails()
Indicates whether this asset type tracks modification details (true) or not (false).
|
static boolean |
hasModificationDetails(Class pojoClass)
Indicates whether assets of this type include modification details (true) or not (false).
|
boolean |
hasProperty(String name)
Indicates whether this asset has a particular property (true) or not (false).
|
static boolean |
isCreatableFromPOJO(Class pojoClass)
Indicates whether IGC assets of the POJO class are capable of being created (true) or not (false).
|
boolean |
isFullyRetrieved() |
static Boolean |
isReference(Object obj)
Returns true iff the provided object is a relationship (ie.
|
Boolean |
isReference(String propertyName)
Returns true iff the provided property name of this object is a relationship (ie.
|
static Boolean |
isReferenceList(Object obj)
Returns true iff the provided object is a list of relationships (ie.
|
Boolean |
isReferenceList(String propertyName)
Returns true iff the provided property name of this object is a list of relationships (ie.
|
static Boolean |
isSimpleType(Object obj)
Returns true iff the provided object is a simple type (String, Number, Boolean, Date, etc).
|
Boolean |
isSimpleType(String propertyName)
Returns true iff the provided property name of this object is a simple type (String, Number, Boolean, Date, etc).
|
boolean |
populateContext(IGCRestClient igcrest)
Ensures that the _context of the asset is populated (takes no action if already populated).
|
boolean |
populateModificationDetails(IGCRestClient igcrest)
Ensures that the modification details of the asset are populated (takes no action if already populated or
the asset does not support them).
|
void |
setContext(ArrayList<Reference> _context) |
void |
setFullyRetrieved() |
void |
setId(String _id) |
void |
setName(String _name) |
void |
setPropertyByName(String name,
Object value)
Sets the value of a property of this asset by the provided name and value (allows dynamic setting of properties).
|
void |
setType(String _type) |
void |
setUrl(String _url) |
getAllFields, toStringprotected ArrayList<Reference> _context
protected String _name
protected String _type
IGCRestClient.registerPOJO(Class).protected String _id
protected String _url
public boolean isFullyRetrieved()
public void setFullyRetrieved()
public Reference getAssetWithSubsetOfProperties(IGCRestClient igcrest, String[] properties, int pageSize, IGCSearchSorting sorting)
igcrest - the IGCRestClient connection to use to retrieve the detailsproperties - a list of the properties to retrievepageSize - the maximum number of each of the asset's relationships to return on this requestsorting - the sorting criteria to use for the resultspublic Reference getAssetWithSubsetOfProperties(IGCRestClient igcrest, String[] properties, int pageSize)
igcrest - the IGCRestClient connection to use to retrieve the detailsproperties - a list of the properties to retrievepageSize - the maximum number of each of the asset's relationships to return on this requestpublic Reference getAssetWithSubsetOfProperties(IGCRestClient igcrest, String[] properties)
igcrest - the IGCRestClient connection to use to retrieve the detailsproperties - a list of the properties to retrievepublic Reference getAssetDetails(IGCRestClient igcrest)
igcrest - the IGCRestClient connection to use to retrieve the detailspublic Reference getFullAssetDetails(IGCRestClient igcrest)
igcrest - the IGCRestClient connection to use to retrieve the details and relationshipspublic Field getFieldByName(String name)
name - the name of the field to retrievepublic boolean hasProperty(String name)
name - the name of the property to checkpublic Object getPropertyByName(String name)
name - the property name to retrievepublic void setPropertyByName(String name, Object value)
name - the property name to set a new value againstvalue - the new value to use for the propertypublic static final Boolean isReference(Object obj)
obj - the object to checkpublic Boolean isReference(String propertyName)
propertyName - the name of the property to checkpublic static final Boolean isReferenceList(Object obj)
obj - the object to checkpublic Boolean isReferenceList(String propertyName)
propertyName - the name of the property to checkpublic static final Boolean isSimpleType(Object obj)
obj - the object to checkpublic Boolean isSimpleType(String propertyName)
propertyName - the name of the property to checkpublic boolean populateModificationDetails(IGCRestClient igcrest)
igcrest - a REST API connection to use in populating the modification detailspublic boolean populateContext(IGCRestClient igcrest)
igcrest - a REST API connection to use in populating the contextpublic Identity getIdentity(IGCRestClient igcrest)
igcrest - a REST API connection to use in confirming the identity of the assetpublic boolean hasModificationDetails()
public static boolean isCreatableFromPOJO(Class pojoClass)
pojoClass - the POJO for which to check an asset's create-abilitypublic static String getDisplayNameFromPOJO(Class pojoClass)
pojoClass - the POJO for which to retrieve an asset's type display namepublic static String getAssetTypeFromPOJO(Class pojoClass)
pojoClass - the POJO for which to retrieve an asset's (REST) typepublic static boolean canAssetBeCreatedFromPOJO(Class pojoClass)
pojoClass - the POJO for which to check create-abilitypublic static List<String> getNonRelationshipPropertiesFromPOJO(Class pojoClass)
pojoClass - the POJO for which to retrieve non-relationship property namesList<String>public static List<String> getStringPropertiesFromPOJO(Class pojoClass)
pojoClass - the POJO for which to retrieve string-valued property namesList<String>public static List<String> getAllPropertiesFromPOJO(Class pojoClass)
pojoClass - the POJO for which to retrieve all property namesList<String>public static List<String> getPagedRelationalPropertiesFromPOJO(Class pojoClass)
pojoClass - the POJO for which to retrieve the paged relationship property namesList<String>public static boolean hasModificationDetails(Class pojoClass)
pojoClass - the POJO for which to check for modification detailspublic static String getAssetTypeForSearch(String assetType)
assetType - the asset type for which to retrieve the search typeCopyright © 2018–2019 ODPi. All rights reserved.