All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.geolatte.mapserver.wms.WMSServiceExceptionList Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2009-2010  Geovise BVBA, QMINO BVBA
 *
 * This file is part of GeoLatte Mapserver.
 *
 * GeoLatte Mapserver is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * GeoLatte Mapserver is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with GeoLatte Mapserver.  If not, see .
 */

package org.geolatte.mapserver.wms;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author Karel Maesen, Geovise BVBA
 *         creation-date: Jul 22, 2010
 */
public class WMSServiceExceptionList implements Iterable {


    List items = new ArrayList();

    public WMSServiceExceptionList add(String message, WMSServiceException.CODE... code) {
        items.add(new Item(message, code));
        return this;
    }

    public boolean isEmpty() {
        return items.isEmpty();
    }

    @Override
    public Iterator iterator() {
        return items.iterator();
    }

    public static class Item {

        private WMSServiceException.CODE code = null;
        private final String message;

        Item(String message, WMSServiceException.CODE... code) {
            this.message = message;
            if (code.length > 0)
                this.code = code[0];
        }

        public WMSServiceException.CODE getCode() {
            return code;
        }

        public String getMessage() {
            return message;
        }

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy