com.craftar
Class CraftARItem
- java.lang.Object
- com.craftar.CraftARItem
-
- Direct Known Subclasses:
- CraftARItemAR
public class CraftARItem extends java.lang.Object
An Item represents an object in a collection in the CraftAR database.
-
-
Constructor Summary
Constructors Constructor and Description CraftARItem(CraftARCollection collection, JSONObject itemJSON)
Creates a CraftARItem given the item's JSON.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected boolean
createFromJson(JSONObject item)
Create aCraftARItem
from aJSONObject
.java.lang.String
getCustom()
Item's url.java.lang.String
getItemId()
Item's uuid.java.lang.String
getItemName()
JSONObject
getJson()
Get the raw JSON object.java.lang.String
getUrl()
Gets the item's url field as aString
.boolean
isAR()
Returns true if the item is an Augmented Reality item.
-
-
-
Constructor Detail
-
CraftARItem
public CraftARItem(CraftARCollection collection, JSONObject itemJSON)
Creates a CraftARItem given the item's JSON.
-
-
Method Detail
-
isAR
public boolean isAR()
Returns true if the item is an Augmented Reality item.
-
getJson
public JSONObject getJson()
Get the raw JSON object. Use this if you have extended the object in your own proxy server. If you use this, please note that the JSON that your server returns must match the structure described in the CraftAR cloud recognition API- Returns:
- The item's raw JSON data.
-
getItemId
public java.lang.String getItemId()
Item's uuid. This value uniquely identifies the item in the CraftAR Service- Returns:
- The item's ID.
-
getItemName
public java.lang.String getItemName()
- Returns:
- The item's name.
-
getUrl
public java.lang.String getUrl()
Gets the item's url field as aString
.- Returns:
- The item's url.
-
getCustom
public java.lang.String getCustom()
Item's url. URL to the item in the CraftAR Service.- Returns:
- The item's custom data.
-
createFromJson
protected boolean createFromJson(JSONObject item)
Create aCraftARItem
from aJSONObject
.- Parameters:
item
- The JSON that represents the CraftAR item- Returns:
- True if the item could be created, false otherwise.
-
-