diff --git a/README.md b/README.md index 14d1b5d..0e3754e 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ poster.deletePin("https:///www.example.com/bar") final PinboardPoster poster = new PinBboardPoster("user:TOKEN"); poster.addPin("https://www.example.com/foo", "This is a test"); -poster.addPin(new AddConfig.Builder() +poster.addPin(new PinConfig.Builder() .url("https://example.com") .description("This is a test") .tags("foo", "bar") diff --git a/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java b/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java index 1331a88..0aa16f0 100644 --- a/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java +++ b/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java @@ -1,34 +1,3 @@ -/* - * JavaExample.java - * - * Copyright (c) 2017-2018, Erik C. Thauvin (erik@thauvin.net) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of this project nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ package net.thauvin.erik.pinboard.samples; import net.thauvin.erik.pinboard.PinConfig; @@ -41,7 +10,7 @@ import java.util.logging.Logger; public class JavaExample { public static void main(String[] args) { - final String url = "httpz://example.com/pinboard"; + final String url = "https://example.com/pinboard"; final PinboardPoster poster; if (args.length == 1) { diff --git a/samples/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt b/samples/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt index 73b3a83..0582144 100644 --- a/samples/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt +++ b/samples/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt @@ -1,34 +1,3 @@ -/* - * KotlinExample.kt - * - * Copyright (c) 2017-2018, Erik C. Thauvin (erik@thauvin.net) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of this project nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ package net.thauvin.erik.pinboard.samples import net.thauvin.erik.pinboard.PinboardPoster @@ -37,7 +6,7 @@ import java.util.logging.ConsoleHandler import java.util.logging.Level fun main(args: Array) { - val url = "httpz://example.com/pinboard" + val url = "https://example.com/pinboard" val poster = if (args.size == 1) { // API Token is an argument diff --git a/src/main/kotlin/net/thauvin/erik/pinboard/PinConfig.kt b/src/main/kotlin/net/thauvin/erik/pinboard/PinConfig.kt index bb6a8fd..f0d6cea 100644 --- a/src/main/kotlin/net/thauvin/erik/pinboard/PinConfig.kt +++ b/src/main/kotlin/net/thauvin/erik/pinboard/PinConfig.kt @@ -108,5 +108,12 @@ class PinConfig private constructor( result = 31 * result + toRead.hashCode() return result } + + override fun toString(): String { + return "Builder(url='$url', description='$description', extended='$extended'," + + "tags=${tags.contentToString()}, dt=$dt, replace=$replace, shared=$shared, toRead=$toRead)" + } + + } }