diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-02-07 00:00:28 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-02-07 00:02:46 +0100 |
commit | e6ecbe4f3ab2c16332c0209033dbb58aa2e28c2a (patch) | |
tree | 6c0015d4739406b98628fe061e2c8e1a02968660 /src/core/lombok/experimental | |
parent | 6484537e2e87ff990b3de574876490f0bdd7e0ec (diff) | |
download | lombok-e6ecbe4f3ab2c16332c0209033dbb58aa2e28c2a.tar.gz lombok-e6ecbe4f3ab2c16332c0209033dbb58aa2e28c2a.tar.bz2 lombok-e6ecbe4f3ab2c16332c0209033dbb58aa2e28c2a.zip |
As we’re preparing to release v2, we want to delete the experimental editions of the Builder and Value annotations… but in case you install lombok v2 into eclipse but use an older lombok as dep in your project, we still do want to process the old annotations. Had to stringly-type a few things to make that happen, but, works now.
Diffstat (limited to 'src/core/lombok/experimental')
-rw-r--r-- | src/core/lombok/experimental/Builder.java | 149 | ||||
-rw-r--r-- | src/core/lombok/experimental/Value.java | 62 |
2 files changed, 0 insertions, 211 deletions
diff --git a/src/core/lombok/experimental/Builder.java b/src/core/lombok/experimental/Builder.java deleted file mode 100644 index 7b364bff..00000000 --- a/src/core/lombok/experimental/Builder.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2013-2017 The Project Lombok Authors. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package lombok.experimental; - -import static java.lang.annotation.ElementType.*; -import static java.lang.annotation.RetentionPolicy.*; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * The builder annotation creates a so-called 'builder' aspect to the class that is annotated or the class - * that contains a member which is annotated with {@code @Builder}. - * <p> - * If a member is annotated, it must be either a constructor or a method. If a class is annotated, - * then a private constructor is generated with all fields as arguments - * (as if {@code @AllArgsConstructor(AccessLevel.PRIVATE)} is present - * on the class), and it is as if this constructor has been annotated with {@code @Builder} instead. - * <p> - * The effect of {@code @Builder} is that an inner class is generated named <code><strong>T</strong>Builder</code>, - * with a private constructor. Instances of <code><strong>T</strong>Builder</code> are made with the - * method named {@code builder()} which is also generated for you in the class itself (not in the builder class). - * <p> - * The <code><strong>T</strong>Builder</code> class contains 1 method for each parameter of the annotated - * constructor / method (each field, when annotating a class), which returns the builder itself. - * The builder also has a <code>build()</code> method which returns a completed instance of the original type, - * created by passing all parameters as set via the various other methods in the builder to the constructor - * or method that was annotated with {@code @Builder}. The return type of this method will be the same - * as the relevant class, unless a method has been annotated, in which case it'll be equal to the - * return type of that method. - * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Builder">the project lombok features page for @Builder</a>. - * <br> - * <p> - * Before: - * - * <pre> - * @Builder - * class Example { - * private int foo; - * private final String bar; - * } - * </pre> - * - * After: - * - * <pre> - * class Example<T> { - * private T foo; - * private final String bar; - * - * private Example(T foo, String bar) { - * this.foo = foo; - * this.bar = bar; - * } - * - * public static <T> ExampleBuilder<T> builder() { - * return new ExampleBuilder<T>(); - * } - * - * public static class ExampleBuilder<T> { - * private T foo; - * private String bar; - * - * private ExampleBuilder() {} - * - * public ExampleBuilder foo(T foo) { - * this.foo = foo; - * return this; - * } - * - * public ExampleBuilder bar(String bar) { - * this.bar = bar; - * return this; - * } - * - * @java.lang.Override public String toString() { - * return "ExampleBuilder(foo = " + foo + ", bar = " + bar + ")"; - * } - * - * public Example build() { - * return new Example(foo, bar); - * } - * } - * } - * </pre> - * - * @deprecated {@link lombok.Builder} has been promoted to the main package, so use that one instead. - */ -@Target({TYPE, METHOD, CONSTRUCTOR}) -@Retention(SOURCE) -@Deprecated -public @interface Builder { - /** @return Name of the method that creates a new builder instance. Default: {@code builder}. */ - String builderMethodName() default "builder"; - - /** @return Name of the method in the builder class that creates an instance of your {@code @Builder}-annotated class. */ - String buildMethodName() default "build"; - - /** - * Name of the builder class. - * - * Default for {@code @Builder} on types and constructors: {@code (TypeName)Builder}. - * <p> - * Default for {@code @Builder} on methods: {@code (ReturnTypeName)Builder}. - * - * @return Name of the builder class that will be generated (or if it already exists, will be filled with builder elements). - */ - String builderClassName() default ""; - - /** - * Normally the builder's 'set' methods are fluent, meaning, they have the same name as the field. Set this - * to {@code false} to name the setter method for field {@code someField}: {@code setSomeField}. - * <p> - * <strong>Default: true</strong> - * - * @return Whether to generate fluent methods (just {@code fieldName()} instead of {@code setFieldName()}). - */ - boolean fluent() default true; - - /** - * Normally the builder's 'set' methods are chaining, meaning, they return the builder so that you can chain - * calls to set methods. Set this to {@code false} to have these 'set' methods return {@code void} instead. - * <p> - * <strong>Default: true</strong> - * - * @return Whether to generate chaining methods (each build call returns itself instead of returning {@code void}). - */ - boolean chain() default true; -} diff --git a/src/core/lombok/experimental/Value.java b/src/core/lombok/experimental/Value.java deleted file mode 100644 index 06dbee13..00000000 --- a/src/core/lombok/experimental/Value.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2012-2017 The Project Lombok Authors. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package lombok.experimental; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Generates a lot of code which fits with a class that is a representation of an immutable entity. - * <p> - * Equivalent to {@code @Getter @FieldDefaults(makeFinal=true, level=AccessLevel.PRIVATE) @RequiredArgsConstructor @ToString @EqualsAndHashCode}. - * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Value">the project lombok features page for @Value</a>. - * - * @see lombok.Getter - * @see Wither - * @see lombok.RequiredArgsConstructor - * @see lombok.ToString - * @see lombok.EqualsAndHashCode - * @see lombok.Data - * @deprecated {@link lombok.Value} has been promoted to the main package, so use that one instead. - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.SOURCE) -@Deprecated -public @interface Value { - /** - * If you specify a static constructor name, then the generated constructor will be private, and - * instead a static factory method is created that other classes can use to create instances. - * We suggest the name: "of", like so: - * - * <pre> - * public @Data(staticConstructor = "of") class Point { final int x, y; } - * </pre> - * - * Default: No static constructor, instead the normal constructor is public. - * - * @return Name of static 'constructor' method to generate (blank = generate a normal constructor). - */ - String staticConstructor() default ""; -} |