org.kisoonlineapp.uc.event.UcKisoonlineAppEvent.java Source code

Java tutorial

Introduction

Here is the source code for org.kisoonlineapp.uc.event.UcKisoonlineAppEvent.java

Source

/*
 * Copyright 2015 berni.
 *
 * 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.kisoonlineapp.uc.event;

import java.io.Serializable;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 *
 * @author berni
 */
public class UcKisoonlineAppEvent implements Serializable {

    public enum UcKisoonlineAppEventType {

        undefined, teilnehmerVeranstaltungAnmelden, teilnehmerVeranstaltungAbmelden,
        // TODO add more types
    }

    private UcKisoonlineAppEventType ucKisoonlineAppEventType;
    // TODO add more args, or params

    protected UcKisoonlineAppEvent() {
        this(UcKisoonlineAppEventType.undefined);
    }

    public UcKisoonlineAppEvent(UcKisoonlineAppEventType ucKisoonlineAppEventType) {
        this.ucKisoonlineAppEventType = ucKisoonlineAppEventType;
    }

    public UcKisoonlineAppEventType getUcKisoonlineAppEventType() {
        return ucKisoonlineAppEventType;
    }

    @Override
    public String toString() {
        final ToStringBuilder tsb = new ToStringBuilder(this);
        tsb.append("ucKisoonlineAppEventType", ucKisoonlineAppEventType);
        final String toString = tsb.build();
        return toString;
    }

    @Override
    public int hashCode() {
        final HashCodeBuilder hcb = new HashCodeBuilder();
        hcb.append(this.ucKisoonlineAppEventType);
        final int hashCode = hcb.build();
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof UcKisoonlineAppEvent)) {
            return false;
        }
        final UcKisoonlineAppEvent other = (UcKisoonlineAppEvent) obj;
        final EqualsBuilder eb = new EqualsBuilder();
        eb.append(this.ucKisoonlineAppEventType, other.ucKisoonlineAppEventType);
        final Boolean equals = eb.build();
        return equals;
    }

}