Made validate function public
This commit is contained in:
parent
8c3687591d
commit
5128916fa1
13 changed files with 70 additions and 48 deletions
|
@ -29,19 +29,21 @@ public class JavaExample {
|
|||
logger.setLevel(Level.FINE);
|
||||
logger.setUseParentHandlers(false);
|
||||
|
||||
// Add Pin
|
||||
if (poster.addPin(new PinConfig.Builder()
|
||||
.url(url)
|
||||
.description("Testing")
|
||||
.extended("Extra")
|
||||
.tags("test", "java")
|
||||
.build())) {
|
||||
System.out.println("Added: " + url);
|
||||
}
|
||||
if (poster.validate()) {
|
||||
// Add Pin
|
||||
if (poster.addPin(new PinConfig.Builder()
|
||||
.url(url)
|
||||
.description("Testing")
|
||||
.extended("Extra")
|
||||
.tags("test", "java")
|
||||
.build())) {
|
||||
System.out.println("Added: " + url);
|
||||
}
|
||||
|
||||
// Delete Pin
|
||||
if (poster.deletePin(url)) {
|
||||
System.out.println("Deleted: " + url);
|
||||
// Delete Pin
|
||||
if (poster.deletePin(url)) {
|
||||
System.out.println("Deleted: " + url);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,15 +20,18 @@ fun main(args: Array<String>) {
|
|||
with(poster.logger) {
|
||||
addHandler(ConsoleHandler().apply { level = Level.FINE })
|
||||
level = Level.FINE
|
||||
useParentHandlers = false
|
||||
}
|
||||
|
||||
// Add Pin
|
||||
if (poster.addPin(url, "Testing", "Extended test", tags = arrayOf("test", "kotlin"))) {
|
||||
println("Added: $url")
|
||||
}
|
||||
if (poster.validate()) {
|
||||
// Add Pin
|
||||
if (poster.addPin(url, "Testing", "Extended test", tags = arrayOf("test", "kotlin"))) {
|
||||
println("Added: $url")
|
||||
}
|
||||
|
||||
// Delete Pin
|
||||
if (poster.deletePin(url)) {
|
||||
println("Deleted: $url")
|
||||
// Delete Pin
|
||||
if (poster.deletePin(url)) {
|
||||
println("Deleted: $url")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue