This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>controls</key> | |
<array> | |
<dict> | |
<key>controlType</key> | |
<string>button</string> | |
<key>keyPath</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.Function; | |
import org.hamcrest.BaseMatcher; | |
import org.hamcrest.Description; | |
public class LambdaMatcher<T> extends BaseMatcher<T> | |
{ | |
private final Function<T, Boolean> matcher; | |
private final String description; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<servers> | |
... | |
<server> | |
<id>ossrh</id> | |
<username>YOUR_OSSRH_JIRA_USER</username> | |
<password>YOUR_OSSRH_JIRA_PASSWORD</password> | |
</server> | |
... | |
<profiles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<build> | |
<plugins> | |
... | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-source-plugin</artifactId> | |
<version>3.0.1</version> | |
<executions> | |
<execution> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<name>${project.groupId}:${project.artifactId}</name> | |
<description>Your artifact description</description> | |
<url>Link to your page or GitHub</url> | |
<licenses> | |
<license> | |
<name>MIT License</name> | |
<url>http://www.opensource.org/licenses/mit-license.php</url> | |
</license> | |
</licenses> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Property with no value | |
Property 'service.endpoint' has a no value. | |
// Property with no @Named annotation | |
Property identified by key 'Key[type=io.pleo.prop.core.Prop<java.lang.String>, annotation=[none]]' has no @Named annotation. | |
// When a valid value was changed to an invalid one | |
Failed to parse property 'service.readTimeout' with value 'potato'. Keeping last valid value of 'PT1S'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MyServiceClass { | |
private AwsClient awsClient; | |
public MyServiceClass(@Named("aws.key") Prop<String> awsKey) { | |
this.awsClient = new AwsClient(awsKey.get()); | |
awsKey.addCallback(() -> this.awsClient = new AwsClient(awsKey.get())); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MyServiceClass { | |
private AwsClient awsClient; | |
public MyServiceClass(@Named("aws.key") Prop<String> awsKey) | |
{ | |
this.awsClient = new AwsClient(awsKey.get()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Module> modules = ... // Get your Guice modules | |
AutoPropModule autoPropModule = new AutoPropModule("io.pleo", // Package prefix | |
modules, // Modules to scan | |
new ArchaiusPropFactory(), | |
new JacksonParserFactory()); | |
modules.add(autoPropModule); | |
Injector injector = Guice.createInjector(modules); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyServiceClient { | |
@Inject | |
public MyServiceClient(@Named("service.endpoint") Prop<String> endpoint, | |
@Named("service.readTimeout") Prop<Duration> readTimeout, | |
HttpClient httpClient) { | |
this.endpoint = endpoint; | |
this.readTimeout = readTimeout; | |
this.httpClient = httpClient; | |
} | |
NewerOlder