/*
 * Copyright 2012 s_wolff.
 *
 * 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
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.aegee.runanddine.advertisement;

import org.aegee.runanddine.util.model.Model;

/**
 * Model for persistent MailingLists
 *
 * @author s_wolff
 */
public class MailingList extends Model {

    private static final long serialVersionUID = 1L;
    /**
     * Manager for MailingLists
     */
    public static final MailingListManager OBJECTS = MailingListManager.getInstance();
    /**
     * Address of MailingList
     */
    private String address;
    /**
     * Name of MailingList
     */
    private String name;

    /**
     * Default constructor
     */
    public MailingList() {
    }

    /**
     * Constructor to set ID, name and address
     *
     * @param id Model ID
     * @param name Name of MailingList
     * @param address Address of MailingList
     */
    public MailingList(int id, String name, String address) {
        this.id = id;
        this.address = address;
        this.name = name;
    }

    /**
     * Set name of MailingList
     *
     * @param name Name of MailingList
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Get name of MailingList
     *
     * @return Name of MailingList
     */
    public String getName() {
        return this.name;
    }

    /**
     * Set address of MailingList
     *
     * @param address Address of MailingList
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * Get address of MailingList
     *
     * @return Address of MailingList
     */
    public String getAddress() {
        return address;
    }

    /**
     * Conversion to string for debugging
     *
     * @return Debug information
     */
    @Override
    public String toString() {
        return String.format("%s [%s]", this.getName(), this.getAddress());
    }
}
