Commit c943dd11 authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

add immutables

parent 777c4fa8
...@@ -162,5 +162,15 @@ ...@@ -162,5 +162,15 @@
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.4</version> <version>2.4</version>
</dependency> </dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>2.4.3</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.immutables</groupId>-->
<!--<artifactId>value</artifactId>-->
<!--<version>2.4.1</version>-->
<!--</dependency>-->
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package com.telephoners.krakyournet.ctf.beans.immutables;
import org.immutables.value.Value;
@Immutable
@Value.Immutable
public interface AbstractTestBean
{
public String getId();
}
package com.telephoners.krakyournet.ctf.beans.immutables;
import org.immutables.value.Value;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.PACKAGE, ElementType.TYPE})
@Retention(RetentionPolicy.CLASS) // Make it class retention for incremental compilation
@Value.Style(
get = {"is*", "get*"}, // Detect 'get' and 'is' prefixes in accessor methods
init = "set*", // Builder initialization methods will have 'set' prefix
typeAbstract = {"Abstract*"}, // 'Abstract' prefix will be detected and trimmed
typeImmutable = "*", // No prefix or suffix for generated immutable type
builder = "new", // construct builder using 'new' instead of factory method
build = "create", // rename 'build' method on builder to 'create'
visibility = Value.Style.ImplementationVisibility.PUBLIC, // Generated class will be always public
defaults = @Value.Immutable(copy = false)) // Disable copy methods by default
public @interface Immutable {}
\ No newline at end of file
package com.telephoners.krakyournet.ctf;
public class LightCouchTest
{
// CouchDbClient dbClient = new CouchDbClient();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment