[Lombok K1] Support @Singular annotation
^KT-46959
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
// FULL_JDK
|
||||
// FILE: User.java
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.Singular;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
public class User {
|
||||
@Singular private java.util.List<String> names;
|
||||
}
|
||||
|
||||
// FILE: UserWithoutNull.java
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.Singular;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
public class UserWithoutNull {
|
||||
@Singular(ignoreNullCollections = false) private java.util.List<String> names;
|
||||
}
|
||||
|
||||
// FILE: UserWithNull.java
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.Singular;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
public class UserWithNull {
|
||||
@Singular(ignoreNullCollections = true) private java.util.List<String> names;
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
fun test() {
|
||||
User.builder()
|
||||
.name("User")
|
||||
.name(<!NULL_FOR_NONNULL_TYPE!>null<!>) // error
|
||||
|
||||
UserWithoutNull.builder()
|
||||
.name("User")
|
||||
.name(<!NULL_FOR_NONNULL_TYPE!>null<!>) // error
|
||||
|
||||
UserWithNull.builder()
|
||||
.name("User")
|
||||
.name(null) // ok
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> assertEquals(/*0*/ a: T, /*1*/ b: T): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
@lombok.Builder @lombok.Data public open class User {
|
||||
public constructor User()
|
||||
@lombok.Singular private final var names: kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open /*synthesized*/ fun getNames(): kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open /*synthesized*/ fun setNames(/*0*/ names: kotlin.collections.(Mutable)List<kotlin.String!>!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun builder(): User.UserBuilder
|
||||
}
|
||||
|
||||
@lombok.Builder @lombok.Data public open class UserWithNull {
|
||||
public constructor UserWithNull()
|
||||
@lombok.Singular(ignoreNullCollections = true) private final var names: kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open /*synthesized*/ fun getNames(): kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open /*synthesized*/ fun setNames(/*0*/ names: kotlin.collections.(Mutable)List<kotlin.String!>!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun builder(): UserWithNull.UserWithNullBuilder
|
||||
}
|
||||
|
||||
@lombok.Builder @lombok.Data public open class UserWithoutNull {
|
||||
public constructor UserWithoutNull()
|
||||
@lombok.Singular(ignoreNullCollections = false) private final var names: kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open /*synthesized*/ fun getNames(): kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open /*synthesized*/ fun setNames(/*0*/ names: kotlin.collections.(Mutable)List<kotlin.String!>!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun builder(): UserWithoutNull.UserWithoutNullBuilder
|
||||
}
|
||||
Reference in New Issue
Block a user