Added ShortenConfig && LookupConfig
This commit is contained in:
parent
63645f7cf4
commit
e20934fc08
15 changed files with 138 additions and 171 deletions
|
@ -1,9 +1,9 @@
|
|||
package com.example;
|
||||
|
||||
import net.thauvin.erik.isgd.Config;
|
||||
import net.thauvin.erik.isgd.Format;
|
||||
import net.thauvin.erik.isgd.Isgd;
|
||||
import net.thauvin.erik.isgd.IsgdException;
|
||||
import net.thauvin.erik.isgd.LookupConfig;
|
||||
|
||||
public final class IsgdSample {
|
||||
public static void main(final String[] args) {
|
||||
|
@ -12,7 +12,7 @@ public final class IsgdSample {
|
|||
try {
|
||||
if (arg.contains("is.gd")) {
|
||||
System.out.println(arg + " <-- " + Isgd.lookup(arg));
|
||||
System.out.print(Isgd.lookup(new Config.Builder().shortUrl(arg).format(Format.WEB).build()));
|
||||
System.out.print(Isgd.lookup(new LookupConfig.Builder(arg).format(Format.WEB).build()));
|
||||
} else {
|
||||
System.out.println(arg + " --> " + Isgd.shorten(arg));
|
||||
}
|
||||
|
|
2
examples/gradle/.idea/gradle.xml
generated
2
examples/gradle/.idea/gradle.xml
generated
|
@ -5,7 +5,7 @@
|
|||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#JAVA_HOME" />
|
||||
<option name="gradleJvm" value="17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
|
2
examples/gradle/.idea/kotlinc.xml
generated
2
examples/gradle/.idea/kotlinc.xml
generated
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.9.20" />
|
||||
<option name="version" value="2.0.0" />
|
||||
</component>
|
||||
</project>
|
|
@ -2,11 +2,13 @@
|
|||
<library name="Gradle: org.jetbrains:annotations:13.0" type="java-imported" external-system-id="GRADLE">
|
||||
<properties groupId="org.jetbrains" artifactId="annotations" version="13.0" />
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/annotations/13.0/annotations-13.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/73368c3b0887f3adc2c2730dd1b95d7c3781aaf3/annotations-13.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/annotations/13.0/annotations-13.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/5991ca87ef1fb5544943d9abc5a9a37583fabe03/annotations-13.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
2
examples/gradle/.idea/misc.xml
generated
2
examples/gradle/.idea/misc.xml
generated
|
@ -3,5 +3,5 @@
|
|||
<component name="PDMPlugin">
|
||||
<option name="skipTestSources" value="false" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="20" project-jdk-type="JavaSDK" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="17" project-jdk-type="JavaSDK" />
|
||||
</project>
|
6
examples/gradle/.idea/modules.xml
generated
6
examples/gradle/.idea/modules.xml
generated
|
@ -2,9 +2,9 @@
|
|||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/isgd-examples.iml" filepath="$PROJECT_DIR$/.idea/modules/isgd-examples.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/isgd-examples.main.iml" filepath="$PROJECT_DIR$/.idea/modules/isgd-examples.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/isgd-examples.test.iml" filepath="$PROJECT_DIR$/.idea/modules/isgd-examples.test.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/isgd-shorten-examples-gradle.iml" filepath="$PROJECT_DIR$/.idea/modules/isgd-shorten-examples-gradle.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/isgd-shorten-examples-gradle.main.iml" filepath="$PROJECT_DIR$/.idea/modules/isgd-shorten-examples-gradle.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/isgd-shorten-examples-gradle.test.iml" filepath="$PROJECT_DIR$/.idea/modules/isgd-shorten-examples-gradle.test.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
12
examples/gradle/.idea/modules/isgd-examples.iml
generated
12
examples/gradle/.idea/modules/isgd-examples.iml
generated
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="isgd-examples" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/../..">
|
||||
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/../../build" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
53
examples/gradle/.idea/modules/isgd-examples.main.iml
generated
53
examples/gradle/.idea/modules/isgd-examples.main.iml
generated
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="isgd-examples:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet external-system-id="GRADLE" type="kotlin-language" name="Kotlin">
|
||||
<configuration version="5" platform="JVM 11" allPlatforms="JVM [11]" useProjectSettings="false">
|
||||
<compilerSettings />
|
||||
<compilerArguments>
|
||||
<flagArguments>
|
||||
<flagArg name="allowNoSourceFiles" arg="true" />
|
||||
<flagArg name="noReflect" arg="true" />
|
||||
<flagArg name="noStdlib" arg="true" />
|
||||
</flagArguments>
|
||||
<stringArguments>
|
||||
<stringArg name="destination" arg="$MODULE_DIR$/../../build/classes/kotlin/main" />
|
||||
<stringArg name="jvmTarget" arg="11" />
|
||||
<stringArg name="moduleName" arg="isgd-examples" />
|
||||
<stringArg name="apiVersion" arg="1.9" />
|
||||
<stringArg name="languageVersion" arg="1.9" />
|
||||
</stringArguments>
|
||||
<arrayArguments>
|
||||
<arrayArg name="pluginClasspaths">
|
||||
<args>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-scripting-jvm/1.9.20/kotlin-scripting-jvm-1.9.20.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-scripting-common/1.9.20/kotlin-scripting-common-1.9.20.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib/1.9.20/kotlin-stdlib-1.9.20.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/annotations/13.0/annotations-13.0.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-script-runtime/1.9.20/kotlin-script-runtime-1.9.20.jar</arg>
|
||||
</args>
|
||||
</arrayArg>
|
||||
<arrayArg name="pluginOptions" />
|
||||
</arrayArguments>
|
||||
</compilerArguments>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager">
|
||||
<output url="file://$MODULE_DIR$/../../build/classes/java/main" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/../../src/main">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../src/main/kotlin" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Gradle: net.thauvin.erik:isgd-shorten:1.0.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.9.20" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Gradle: net.thauvin.erik.urlencoder:urlencoder-lib-jvm:1.4.0" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10" level="project" />
|
||||
</component>
|
||||
</module>
|
53
examples/gradle/.idea/modules/isgd-examples.test.iml
generated
53
examples/gradle/.idea/modules/isgd-examples.test.iml
generated
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="isgd-examples:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet external-system-id="GRADLE" type="kotlin-language" name="Kotlin">
|
||||
<configuration version="5" platform="JVM 11" allPlatforms="JVM [11]" useProjectSettings="false">
|
||||
<additionalVisibleModuleNames>isgd-examples:main</additionalVisibleModuleNames>
|
||||
<compilerSettings />
|
||||
<compilerArguments>
|
||||
<flagArguments>
|
||||
<flagArg name="allowNoSourceFiles" arg="true" />
|
||||
<flagArg name="noReflect" arg="true" />
|
||||
<flagArg name="noStdlib" arg="true" />
|
||||
</flagArguments>
|
||||
<stringArguments>
|
||||
<stringArg name="destination" arg="$MODULE_DIR$/../../build/classes/kotlin/test" />
|
||||
<stringArg name="jvmTarget" arg="11" />
|
||||
<stringArg name="moduleName" arg="isgd-examples_test" />
|
||||
<stringArg name="apiVersion" arg="1.9" />
|
||||
<stringArg name="languageVersion" arg="1.9" />
|
||||
</stringArguments>
|
||||
<arrayArguments>
|
||||
<arrayArg name="pluginClasspaths">
|
||||
<args>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-scripting-jvm/1.9.20/kotlin-scripting-jvm-1.9.20.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-scripting-common/1.9.20/kotlin-scripting-common-1.9.20.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib/1.9.20/kotlin-stdlib-1.9.20.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/annotations/13.0/annotations-13.0.jar</arg>
|
||||
<arg>$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-script-runtime/1.9.20/kotlin-script-runtime-1.9.20.jar</arg>
|
||||
</args>
|
||||
</arrayArg>
|
||||
<arrayArg name="pluginOptions" />
|
||||
</arrayArguments>
|
||||
</compilerArguments>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager">
|
||||
<output-test url="file://$MODULE_DIR$/../../build/classes/java/test" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/../../src/test" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="isgd-examples.main" />
|
||||
<orderEntry type="library" name="Gradle: net.thauvin.erik:isgd-shorten:1.0.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.9.20" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Gradle: net.thauvin.erik.urlencoder:urlencoder-lib-jvm:1.4.0" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10" level="project" />
|
||||
</component>
|
||||
<component name="TestModuleProperties" production-module="isgd-examples.main" />
|
||||
</module>
|
|
@ -1,9 +1,9 @@
|
|||
package com.example;
|
||||
|
||||
import net.thauvin.erik.isgd.Config;
|
||||
import net.thauvin.erik.isgd.Format;
|
||||
import net.thauvin.erik.isgd.Isgd;
|
||||
import net.thauvin.erik.isgd.IsgdException;
|
||||
import net.thauvin.erik.isgd.LookupConfig;
|
||||
|
||||
public final class IsgdSample {
|
||||
public static void main(final String[] args) {
|
||||
|
@ -12,7 +12,7 @@ public final class IsgdSample {
|
|||
try {
|
||||
if (arg.contains("is.gd")) {
|
||||
System.out.println(arg + " <-- " + Isgd.lookup(arg));
|
||||
System.out.print(Isgd.lookup(new Config.Builder().shortUrl(arg).format(Format.WEB).build()));
|
||||
System.out.print(Isgd.lookup(new LookupConfig.Builder(arg).format(Format.WEB).build()));
|
||||
} else {
|
||||
System.out.println(arg + " --> " + Isgd.shorten(arg));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue