Made autogenerated fields final

This commit is contained in:
Konstantin Shandurenko 2021-02-25 09:01:13 +03:00
parent 7db7dab4b9
commit c8d0b783d8
2 changed files with 9 additions and 9 deletions

View File

@ -340,21 +340,21 @@ public enum EntityType {
private static final EntityType[] VALUES = values();
@NotNull
private String namespaceID;
private final String namespaceID;
private double width;
private final double width;
private double height;
private final double height;
@NotNull
private BiFunction<Entity, Metadata, EntityMeta> metaConstructor;
private final BiFunction<Entity, Metadata, EntityMeta> metaConstructor;
@NotNull
private EntitySpawnType spawnType;
private final EntitySpawnType spawnType;
EntityType(@NotNull final String namespaceID, final double width, final double height,
@NotNull final BiFunction<Entity, Metadata, EntityMeta> metaConstructor,
@NotNull final EntitySpawnType spawnType) {
EntityType(@NotNull String namespaceID, double width, double height,
@NotNull BiFunction<Entity, Metadata, EntityMeta> metaConstructor,
@NotNull EntitySpawnType spawnType) {
this.namespaceID = namespaceID;
this.width = width;
this.height = height;

View File

@ -95,7 +95,7 @@ public class EnumGenerator implements CodeGenerator {
// properties
for (ParameterSpec property : parameters) {
enumClass.addField(FieldSpec.builder(property.type, property.name)
.addModifiers(Modifier.PRIVATE)
.addModifiers(Modifier.PRIVATE, Modifier.FINAL)
.addAnnotations(property.annotations)
.build());
}