Android Open Source - conference-central-android-app Decorated Conference






From Project

Back to project page conference-central-android-app.

License

The source code is released under:

GNU General Public License

If you think the Android project conference-central-android-app 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 2014 Google Inc. All Rights Reserved.
 */* w w w  . jav  a 2 s. 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
 *
 *     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 com.udacity.devrel.training.conference.android.utils;

import com.appspot.udacity_extras.conference.model.Conference;

/**
 * A wrapper around the {@link com.appspot.udacity_extras.conference.model.Conference}
 * to enable adding additional fields and operations.
 */
public class DecoratedConference {

    private Conference mConference;
    private boolean mRegistered;

    public DecoratedConference(Conference conference, boolean registered) {
        mConference = conference;

        /* keeps the status of user's attendance to this conference */
        mRegistered = registered;
    }

    public Conference getConference() {
        return mConference;
    }

    public void setConference(Conference conference) {
        mConference = conference;
    }

    public boolean isRegistered() {
        return mRegistered;
    }

    public void setRegistered(boolean registered) {
        mRegistered = registered;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        DecoratedConference that = (DecoratedConference) o;

        if (mConference != null ? !mConference.equals(that.mConference)
                : that.mConference != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return mConference != null ? mConference.hashCode() : 0;
    }
}




Java Source Code List

com.udacity.devrel.training.conference.android.AppConstants.java
com.udacity.devrel.training.conference.android.ConferenceDataAdapter.java
com.udacity.devrel.training.conference.android.ConferenceListFragment.java
com.udacity.devrel.training.conference.android.ConferenceLoader.java
com.udacity.devrel.training.conference.android.MainActivity.java
com.udacity.devrel.training.conference.android.utils.ConferenceException.java
com.udacity.devrel.training.conference.android.utils.ConferenceUtils.java
com.udacity.devrel.training.conference.android.utils.DecoratedConference.java
com.udacity.devrel.training.conference.android.utils.Utils.java