Android Open Source - 3DR-Services-Library Connection Result






From Project

Back to project page 3DR-Services-Library.

License

The source code is released under:

Apache License

If you think the Android project 3DR-Services-Library 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

package com.ox3dr.services.android.lib.drone.connection;
/*from w  w w  .ja va2  s  .  c om*/
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Conveys information if the connection attempt fails.
 */
public final class ConnectionResult implements Parcelable {

    private final int mErrorCode;
    private final String mErrorMessage;

    public ConnectionResult(int errorCode, String errorMessage) {
        this.mErrorCode = errorCode;
        this.mErrorMessage = errorMessage;
    }

    public int getErrorCode() {
        return mErrorCode;
    }

    public String getErrorMessage() {
        return mErrorMessage;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.mErrorCode);
        dest.writeString(this.mErrorMessage);
    }

    private ConnectionResult(Parcel in) {
        this.mErrorCode = in.readInt();
        this.mErrorMessage = in.readString();
    }

    public static final Parcelable.Creator<ConnectionResult> CREATOR = new Parcelable.Creator<ConnectionResult>() {
        public ConnectionResult createFromParcel(Parcel source) {
            return new ConnectionResult(source);
        }

        public ConnectionResult[] newArray(int size) {
            return new ConnectionResult[size];
        }
    };

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ConnectionResult)) return false;

        ConnectionResult that = (ConnectionResult) o;

        if (mErrorCode != that.mErrorCode) return false;
        if (mErrorMessage != null ? !mErrorMessage.equals(that.mErrorMessage) : that.mErrorMessage != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = mErrorCode;
        result = 31 * result + (mErrorMessage != null ? mErrorMessage.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "ConnectionResult{" +
                "mErrorCode=" + mErrorCode +
                ", mErrorMessage='" + mErrorMessage + '\'' +
                '}';
    }
}




Java Source Code List

com.ox3dr.services.android.lib.ApplicationTest.java
com.ox3dr.services.android.lib.coordinate.LatLngAlt.java
com.ox3dr.services.android.lib.coordinate.LatLng.java
com.ox3dr.services.android.lib.drone.connection.ConnectionParameter.java
com.ox3dr.services.android.lib.drone.connection.ConnectionResult.java
com.ox3dr.services.android.lib.drone.connection.ConnectionType.java
com.ox3dr.services.android.lib.drone.event.Event.java
com.ox3dr.services.android.lib.drone.event.Extra.java
com.ox3dr.services.android.lib.drone.property.Altitude.java
com.ox3dr.services.android.lib.drone.property.Attitude.java
com.ox3dr.services.android.lib.drone.property.Battery.java
com.ox3dr.services.android.lib.drone.property.Gps.java
com.ox3dr.services.android.lib.drone.property.Home.java
com.ox3dr.services.android.lib.drone.property.MissionItemMessage.java
com.ox3dr.services.android.lib.drone.property.Mission.java
com.ox3dr.services.android.lib.drone.property.Parameter.java
com.ox3dr.services.android.lib.drone.property.Parameters.java
com.ox3dr.services.android.lib.drone.property.Speed.java
com.ox3dr.services.android.lib.drone.property.State.java
com.ox3dr.services.android.lib.drone.property.Type.java
com.ox3dr.services.android.lib.drone.property.VehicleMode.java