org.gbanga.api
Class Trade

java.lang.Object
  extended by org.gbanga.api.Event
      extended by org.gbanga.api.Trade

public class Trade
extends Event

A trade is a deal between two parties.

Details about JSON serialization

For the JSON object serialization, the field names are used. Eg.

 {
   partner: { name: "some name" },
   offerings: [
                { id: 4343 },
                { id: 3422 } 
              ]
 }
 

Fields annotated with PrimaryKey are used, if not the whole object is sent. HideIfNull indicates that the field is not sent at all, if the value is not set.

Author:
Matthias

Nested Class Summary
static class Trade.TradeItem
          A container class for general items used in a trade.
 
Field Summary
static java.lang.String ABORTED
          The Event.partner has declined the trade
static java.lang.String ACCEPTED
          The Event.partner has accepted the trade
static java.lang.String OFFERED
          Offering and request have been sent to Event.partner
 Trade.TradeItem[] offerings
          The items currently included in the offer that would go to the Event.partner
static java.lang.String PREPARING
          The trade is to be started (initial phase where offerings are being prepared)
 Trade.TradeItem[] requests
          Items requested from the Event.partner's Pocket
 java.lang.String state
          State this trade is in
 int type
          The type of a Trade Event.
 
Fields inherited from class org.gbanga.api.Event
booleanParameters, cell, CELL_DISCOVERED, CHALLENGE, CHAT_MESSAGE_RECEIVED, CONVERSATION, CONVERSATION_MESSAGE_RECEIVED, FRIEND_BROKE, gbangoo, GBANGOO_DROPPED, GBANGOO_LIFTED, GIFT_IN_POCKET_RECEIVED, id, infrastructure, longParameters, partner, player, PLAYER_ARRIVED, PLAYER_LEFT, POCKET_ITEM_LOST, PUZZLE_COMPLETED, resource, shortParameters, SHOUT_MESSAGE_RECEIVED, stringParameters, t, tag, TAG_CODE_ENTERED, tile, TRADE, TRADE_OFFER_RECEIVED, UNKNOWN, VISIT
 
Constructor Summary
Trade()
          Creates a new Trade object.
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABORTED

public static final java.lang.String ABORTED
The Event.partner has declined the trade

See Also:
Constant Field Values

ACCEPTED

public static final java.lang.String ACCEPTED
The Event.partner has accepted the trade

See Also:
Constant Field Values

OFFERED

public static final java.lang.String OFFERED
Offering and request have been sent to Event.partner

See Also:
Constant Field Values

offerings

public Trade.TradeItem[] offerings
The items currently included in the offer that would go to the Event.partner


PREPARING

public static final java.lang.String PREPARING
The trade is to be started (initial phase where offerings are being prepared)

See Also:
Constant Field Values

requests

public Trade.TradeItem[] requests
Items requested from the Event.partner's Pocket


state

public java.lang.String state
State this trade is in

See Also:
PREPARING, OFFERED, ACCEPTED, ABORTED

type

@PrimaryKey
public int type
The type of a Trade Event.

Constructor Detail

Trade

public Trade()
Creates a new Trade object.