Android Open Source - gdx-pay Offer

From Project

Back to project page gdx-pay.


The source code is released under:

Apache License Version 2.0, January 2004 TERMS AND CONDITIONS FOR USE, REPRODUC...

If you think the Android project gdx-pay listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

 * Copyright 2011 See AUTHORS file.//  w w w .  j  a va 2s .c o  m
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.


import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/** A product offer that can be purchased. */
public class Offer {

  /** The offer type. */
  private OfferType type;

  /** The default identifier that is used to identify purchases and also serves as default for stores where no specific identifier
   * has been set. */
  private String identifier;
  /** Store specific identifiers. For simplicity it's probably best to not set one but use the default identifier instead. */
  private Map<String, String> identifierForStores = new HashMap<String, String>(16);

  public synchronized OfferType getType () {
    return type;

  public synchronized Offer setType (OfferType type) {
    this.type = type;

    // and return this for chaining
    return this;

  public synchronized String getIdentifier () {
    return identifier;

  public synchronized Offer setIdentifier (String identifier) {
    this.identifier = identifier;

    // and return this for chaining
    return this;

  public synchronized String getIdentifierForStore (String storeName) {
    String identifier = identifierForStores.get(storeName);
    if (identifier != null) {
      return identifier;
    } else {
      // we use our default
      return this.identifier;

    public synchronized Set<Map.Entry<String, String>> getIdentifierForStores () {
        return identifierForStores.entrySet();

  public synchronized Offer putIdentifierForStore (String storeName, String identifierForStore) {
    identifierForStores.put(storeName, identifierForStore);

    // and return this for chaining
    return this;

Java Source Code List