You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Generated(from = "SomeClass", generator = "Immutables")
@SuppressWarnings({"all"})
@ParametersAreNonnullByDefault@javax.annotation.Generated("org.immutables.processor.ProxyProcessor")
@Immutable@CheckReturnValuepublicfinalclassImmutableSomeClassextendsSomeClass {
privatefinalStringvalue;
/** * Construct a new immutable {@code SomeClass} instance. * @param value The value for the {@code value} attribute */publicImmutableSomeClass(Stringvalue) {
this.value = Objects.requireNonNull(value, "value");
}
privateImmutableSomeClass(ImmutableSomeClassoriginal, Stringvalue) {
this.value = value;
}
/** * @return The value of the {@code value} attribute */@OverridepublicStringgetValue() {
returnvalue;
}
// Some other stuff
}
I would expect the constructor public ImmutableSomeClass(String value) {..} to be annotated with @PersistenceConstructor. But this only happens if SomeClass is annotated with @PersistenceConstructorInjected.
Is this not supported or am I doing something wrong?
The text was updated successfully, but these errors were encountered:
thank you for raising this! sorry for the very late response. IIRC annotation injection does not work as a meta-annotation and not quite like a style annotation. But to save some typing it can be placed on a enclosing package (using package-info.java etc)
The
@InjectAnnotation
is not considered when a custom immutable annotation is annotated with it.As Example
InjectAnnotation:
Custom immutable annotation:
Abstract class
Generated immutable:
I would expect the constructor
public ImmutableSomeClass(String value) {..}
to be annotated with@PersistenceConstructor
. But this only happens ifSomeClass
is annotated with@PersistenceConstructorInjected
.Is this not supported or am I doing something wrong?
The text was updated successfully, but these errors were encountered: