JAVA-10625: Remove module immutables
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.baeldung.immutable;
|
||||
|
||||
import org.immutables.value.Value;
|
||||
|
||||
@Value.Immutable
|
||||
public interface Address {
|
||||
String getStreetName();
|
||||
Integer getNumber();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.baeldung.immutable;
|
||||
|
||||
import org.immutables.value.Value;
|
||||
|
||||
@Value.Immutable
|
||||
public abstract class Person {
|
||||
abstract String getName();
|
||||
abstract Integer getAge();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.baeldung.immutable.auxiliary;
|
||||
|
||||
|
||||
import org.immutables.value.Value;
|
||||
|
||||
@Value.Immutable
|
||||
public abstract class Person {
|
||||
abstract String getName();
|
||||
abstract Integer getAge();
|
||||
|
||||
@Value.Auxiliary
|
||||
abstract String getAuxiliaryField();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.immutable.default_;
|
||||
|
||||
import org.immutables.value.Value;
|
||||
|
||||
@Value.Immutable(prehash = true)
|
||||
public abstract class Person {
|
||||
|
||||
abstract String getName();
|
||||
|
||||
@Value.Default
|
||||
Integer getAge() {
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.immutable.parameter;
|
||||
|
||||
|
||||
import org.immutables.value.Value;
|
||||
|
||||
@Value.Immutable
|
||||
public abstract class Person {
|
||||
|
||||
@Value.Parameter
|
||||
abstract String getName();
|
||||
|
||||
@Value.Parameter
|
||||
abstract Integer getAge();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.baeldung.immutable.prehash;
|
||||
|
||||
import org.immutables.value.Value;
|
||||
|
||||
@Value.Immutable(prehash = true)
|
||||
public abstract class Person {
|
||||
abstract String getName();
|
||||
abstract Integer getAge();
|
||||
}
|
||||
Reference in New Issue
Block a user