Package net.amcintosh.freshbooks.models
Class Item
java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.json.GenericJson
net.amcintosh.freshbooks.models.Item
- All Implemented Interfaces:
Cloneable
,Map<String,
,Object> ConvertibleContent
Items are stored from invoice lines to make invoicing easier in the future.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet unique identifier of business item exists on.Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.Descriptive text for item.long
getId()
Get the unique identifier of this item within this business.Decimal-string count of inventory.long
Duplicate of id.getName()
Descriptive name of item.Decimal quantity to multiply unit cost by.getSku()
Id for a specific item or product, used in inventory management.long
getTax1()
Id of the first tax to apply to this item.long
getTax2()
Id of the second tax to apply to this item.Unit cost of the item.Get the time of last modification.Get the visibility state: active, deleted, or archivedvoid
setDescription
(String description) Descriptive text for item.void
setInventory
(String inventory) Decimal-string count of inventory.void
Descriptive name of item.void
setQuantity
(int quantity) Quantity to multiply unit cost by.void
setQuantity
(String quantity) Quantity to multiply unit cost by.void
setQuantity
(BigDecimal quantity) Decimal quantity to multiply unit cost by.void
Id for a specific item or product, used in inventory management.void
setTax1
(long tax1) Id of the first tax to apply to this item.void
setTax2
(long tax2) Id of the second tax to apply to this item.void
setUnitCost
(Money unitCost) Unit cost of the item.void
setVisState
(VisState visState) Set the visibility state of the item.Methods inherited from class com.google.api.client.json.GenericJson
clone, getFactory, set, setFactory, toPrettyString, toString
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
Item
public Item()
-
-
Method Details
-
getId
public long getId()Get the unique identifier of this item within this business.- Returns:
-
getAccountingSystemId
Get unique identifier of business item exists on.- Returns:
- Accounting System Id
-
getItemId
public long getItemId()Duplicate of id.- Returns:
-
getDescription
Descriptive text for item.- Returns:
- Eg. "65L BackPack"
-
setDescription
Descriptive text for item.- Parameters:
description
- Eg. "65L BackPack"
-
getInventory
Decimal-string count of inventory.- Returns:
- Eg. 10
-
setInventory
Decimal-string count of inventory.- Parameters:
inventory
- Eg. 10
-
getName
Descriptive name of item.- Returns:
- e.g. "BackPack"
-
setName
Descriptive name of item.- Parameters:
name
- e.g. "GST"
-
getQuantity
Decimal quantity to multiply unit cost by.- Returns:
-
setQuantity
Decimal quantity to multiply unit cost by.- Parameters:
quantity
-
-
setQuantity
public void setQuantity(int quantity) Quantity to multiply unit cost by.- Parameters:
quantity
-
-
setQuantity
Quantity to multiply unit cost by.- Parameters:
quantity
-
-
getSku
Id for a specific item or product, used in inventory management.- Returns:
-
setSku
Id for a specific item or product, used in inventory management.- Parameters:
sku
-
-
getTax1
public long getTax1()Id of the first tax to apply to this item.- Returns:
-
setTax1
public void setTax1(long tax1) Id of the first tax to apply to this item.- Parameters:
tax1
-
-
getTax2
public long getTax2()Id of the second tax to apply to this item.- Returns:
-
setTax2
public void setTax2(long tax2) Id of the second tax to apply to this item.- Parameters:
tax2
-
-
getUnitCost
Unit cost of the item.- Returns:
-
setUnitCost
Unit cost of the item.- Parameters:
unitCost
-
-
getUpdated
Get the time of last modification.
Note: The API returns this data in "US/Eastern", but it is converted to UTC.- Returns:
- Updated time in UTC
-
getVisState
Get the visibility state: active, deleted, or archived- Returns:
- Enum of the visibility state.
- See Also:
-
setVisState
Set the visibility state of the item.- Parameters:
visState
- VisState value- See Also:
-
getContent
Description copied from interface:ConvertibleContent
Return the objects values as a Map suitable to sending to FreshBooks in a POST or PUT request.- Specified by:
getContent
in interfaceConvertibleContent
- Returns:
-