Skip to content

Commit 01127b4

Browse files
committed
annotations
1 parent 016f1ad commit 01127b4

File tree

13 files changed

+55
-4
lines changed

13 files changed

+55
-4
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.falsepattern.lib;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
7+
/**
8+
* Anything annotated with this annotation will be considered stable, and the class/method/field will not get breaking
9+
* changes without a full deprecation cycle.
10+
*
11+
* If a class or method is NOT annotated with this annotation, it will be considered unstable, and the package/method arguments/etc.
12+
* can freely change between patch releases without notice.
13+
*
14+
* If a class is annotated with this annotation, all currently existing public and protected members in the class will
15+
* be considered stable.
16+
*
17+
* Private members will never be considered stable, and can be removed without notice.
18+
*/
19+
@Documented
20+
@Retention(RetentionPolicy.CLASS)
21+
@StableAPI(since = "0.6.0")
22+
public @interface StableAPI {
23+
String since();
24+
}

src/main/java/com/falsepattern/lib/compat/BlockPos.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.falsepattern.lib.compat;
22

3+
import com.falsepattern.lib.StableAPI;
34
import com.google.common.collect.AbstractIterator;
45
import com.google.common.collect.Lists;
56
import cpw.mods.fml.relauncher.Side;
@@ -16,6 +17,7 @@
1617
import java.util.List;
1718

1819
@Immutable
20+
@StableAPI(since = "0.6.0")
1921
public class BlockPos extends Vec3i {
2022
/**
2123
* An immutable block pos with zero as all coordinates.

src/main/java/com/falsepattern/lib/compat/ChunkPos.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
package com.falsepattern.lib.compat;
22

3+
import com.falsepattern.lib.StableAPI;
34
import net.minecraft.entity.Entity;
45

6+
import javax.annotation.concurrent.Immutable;
7+
8+
@Immutable
9+
@StableAPI(since = "0.6.0")
510
public class ChunkPos {
611
/**
712
* The X position of this Chunk Coordinate Pair

src/main/java/com/falsepattern/lib/compat/Rotation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.falsepattern.lib.compat;
22

3+
import com.falsepattern.lib.StableAPI;
34
import net.minecraft.util.EnumFacing;
45

6+
@StableAPI(since = "0.6.0")
57
public enum Rotation {
68
NONE("rotate_0"),
79
CLOCKWISE_90("rotate_90"),

src/main/java/com/falsepattern/lib/compat/Vec3i.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.falsepattern.lib.compat;
22

3+
import com.falsepattern.lib.StableAPI;
34
import net.minecraft.util.MathHelper;
45

56
import javax.annotation.concurrent.Immutable;
67
import java.util.Objects;
78

89
@Immutable
10+
@StableAPI(since = "0.6.0")
911
public class Vec3i implements Comparable<Vec3i> {
1012
/**
1113
* An immutable vector with zero as all coordinates.

src/main/java/com/falsepattern/lib/config/Config.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package com.falsepattern.lib.config;
22

3-
import java.lang.annotation.ElementType;
4-
import java.lang.annotation.Retention;
5-
import java.lang.annotation.RetentionPolicy;
6-
import java.lang.annotation.Target;
3+
import com.falsepattern.lib.StableAPI;
74

5+
import java.lang.annotation.*;
6+
7+
@Documented
88
@Retention(RetentionPolicy.RUNTIME)
99
@Target(ElementType.TYPE)
10+
@StableAPI(since = "0.6.0")
1011
public @interface Config {
1112
/**
1213
* The mod id that this configuration is associated with.

src/main/java/com/falsepattern/lib/config/ConfigurationManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.falsepattern.lib.config;
22

3+
import com.falsepattern.lib.StableAPI;
34
import cpw.mods.fml.client.event.ConfigChangedEvent;
45
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
56
import lombok.AccessLevel;
@@ -18,6 +19,7 @@
1819
* Class for controlling the loading of configuration files.
1920
*/
2021
@NoArgsConstructor(access = AccessLevel.PRIVATE)
22+
@StableAPI(since = "0.6.0")
2123
public class ConfigurationManager {
2224
private static final Map<String, Set<Class<?>>> configs = new HashMap<>();
2325

src/main/java/com/falsepattern/lib/dependencies/ComplexVersion.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.falsepattern.lib.dependencies;
22

3+
import com.falsepattern.lib.StableAPI;
34
import lombok.NonNull;
45
import lombok.val;
56

67
import java.util.Arrays;
78
import java.util.stream.Collectors;
89

10+
@StableAPI(since = "0.6.0")
911
public class ComplexVersion extends Version {
1012
final Version[] versions;
1113
public ComplexVersion(@NonNull Version mainVersion, Version... subVersions) {

src/main/java/com/falsepattern/lib/dependencies/DependencyLoader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.falsepattern.lib.dependencies;
22

3+
import com.falsepattern.lib.StableAPI;
34
import com.falsepattern.lib.internal.CoreLoadingPlugin;
45
import com.falsepattern.lib.internal.FalsePatternLib;
56
import lombok.NonNull;
@@ -13,6 +14,7 @@
1314
import java.util.*;
1415

1516

17+
@StableAPI(since = "0.6.0")
1618
public class DependencyLoader {
1719

1820
private static final Map<String, Version> loadedLibraries = new HashMap<>();

src/main/java/com/falsepattern/lib/dependencies/SemanticVersion.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package com.falsepattern.lib.dependencies;
22

3+
import com.falsepattern.lib.StableAPI;
34
import lombok.Builder;
45
import lombok.Getter;
56
import lombok.NonNull;
67
import lombok.val;
78

89
import java.util.Objects;
910

11+
@StableAPI(since = "0.6.0")
1012
public class SemanticVersion extends Version {
1113
@Getter
1214
private final int majorVersion;

0 commit comments

Comments
 (0)