You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
etesync-android/app/src/main/java/com/etesync/syncadapter/ui/setup/LoginCredentials.kt

46 lines
1.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* Copyright © 2013 2016 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*/
package com.etesync.syncadapter.ui.setup
import android.os.Parcel
import android.os.Parcelable
import com.etesync.syncadapter.Constants
import com.etesync.syncadapter.log.Logger
import java.net.URI
import java.net.URISyntaxException
class LoginCredentials(val uri: URI?, val userName: String, val password: String) : Parcelable {
override fun describeContents(): Int {
return 0
}
override fun writeToParcel(dest: Parcel, flags: Int) {
dest.writeSerializable(uri)
dest.writeString(userName)
dest.writeString(password)
}
companion object {
@JvmField
val CREATOR: Parcelable.Creator<*> = object : Parcelable.Creator<LoginCredentials> {
override fun createFromParcel(source: Parcel): LoginCredentials {
return LoginCredentials(
source.readSerializable() as URI,
source.readString()!!, source.readString()!!
)
}
override fun newArray(size: Int): Array<LoginCredentials?> {
return arrayOfNulls(size)
}
}
}
}