Commit 4df7fb10 authored by Ricki Hirner's avatar Ricki Hirner 🐑

Use ToStringBuilder

parent 3f5c2d96
Pipeline #18019800 failed with stage
in 60 minutes and 4 seconds
......@@ -32,6 +32,7 @@ import ezvcard.property.*
import ezvcard.util.PartialDate
import org.apache.commons.io.IOUtils
import org.apache.commons.lang3.StringUtils
import org.apache.commons.lang3.builder.ToStringBuilder
import org.apache.commons.lang3.text.WordUtils
import java.io.ByteArrayOutputStream
import java.io.FileNotFoundException
......@@ -41,7 +42,6 @@ import java.text.SimpleDateFormat
import java.util.*
import java.util.logging.Level
// FIXME @ToString(of={ "id","fileName","eTag","contact" }, doNotUseGetters=true)
open class AndroidContact(
val addressBook: AndroidAddressBook<AndroidContact, AndroidGroup>
) {
......@@ -1235,6 +1235,11 @@ open class AndroidContact(
}
override fun toString() = ToStringBuilder.reflectionToString(this)!!
// helpers
protected fun queryPhotoMaxDimensions(): Int {
try {
addressBook.provider.query(ContactsContract.DisplayPhoto.CONTENT_MAX_DIMENSIONS_URI,
......@@ -1248,7 +1253,6 @@ open class AndroidContact(
return 720
}
protected fun rawContactSyncURI(): Uri {
val id = requireNotNull(id)
return addressBook.syncAdapterURI(ContentUris.withAppendedId(ContactsContract.RawContacts.CONTENT_URI, id))
......
......@@ -165,11 +165,7 @@ open class AndroidGroup(
}
override fun toString() = ToStringBuilder(this)
.append(id)
.append(fileName)
.append(this::class.java.getField("contact").toString())
.build()!!
override fun toString() = ToStringBuilder.reflectionToString(this)!!
// helpers
......
......@@ -133,8 +133,6 @@ class Contact {
return contacts
}
//@SuppressWarnings("LoopStatementThatDoesntLoop")
@JvmStatic
private fun fromVCard(vCard: VCard, downloader: Downloader?): Contact {
val c = Contact()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment