com.chrisdempewolf.pinterest.fields.FieldSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pinterest-sdk Show documentation
Show all versions of pinterest-sdk Show documentation
An SDK for Pinterest's version 1.0 API.
package com.chrisdempewolf.pinterest.fields
import java.util.regex.Pattern
object FieldSerializer {
private val INVALID_CHAR_PATTERN = Pattern.compile("[\\[\\] ]")
@JvmStatic
fun serialize(fields: Set?): String
= if (fields == null) ""
else INVALID_CHAR_PATTERN.matcher(fields.toString()).replaceAll("")
}