Examples of AdvertisementError


Examples of other.advertisement.errors.AdvertisementError

        return ExtensionObject.Configuration.get("helppage");
    }

    public int setAdvertisement(String advertisementText, short timePeriod) {
        if (this.advertisements.size() == this.maxAdvertisementCount) {
            throw new AdvertisementError("Maximum advertisement count reached");
        }

        short advertisementId = this.generateId();

        if (advertisementText != null && !advertisementText.isEmpty()) {
            Advertisement ad = new Advertisement(advertisementText, timePeriod, this);
            ad.setAdvertisementId(advertisementId);

            this.advertisements.add(ad);
        } else {
            throw new AdvertisementError("Advertisement text should not be empty");
        }

        return advertisementId;
    }
View Full Code Here

Examples of other.advertisement.errors.AdvertisementError

        if (advertisement != null) {
            advertisement.stopAdvertisementTimer();

            this.advertisements.remove(advertisement);
        } else {
            throw new AdvertisementError(String.format("No advertisement with id=[%d]", advertisementId));
        }

        return advertisement;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.