Minor cleanup
This commit is contained in:
parent
fc77b73399
commit
ca6e0e2f0f
4 changed files with 10 additions and 65 deletions
|
@ -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")
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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<String>) {
|
||||
val url = "httpz://example.com/pinboard"
|
||||
val url = "https://example.com/pinboard"
|
||||
|
||||
val poster = if (args.size == 1) {
|
||||
// API Token is an argument
|
||||
|
|
|
@ -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)"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue