Skip to content

Commit 7d56d5f

Browse files
committed
rename FixedString size to length
1 parent b5227ba commit 7d56d5f

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

examples/src/main/java/com/github/elebras1/flecs/examples/components/Label.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
import com.github.elebras1.flecs.annotation.FixedString;
55

66
@Component
7-
public record Label(@FixedString(size = 32) String label) {
7+
public record Label(@FixedString(length = 32) String label) {
88
}

examples/src/main/java/com/github/elebras1/flecs/examples/components/Minister.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
import com.github.elebras1.flecs.annotation.FixedString;
55

66
@Component
7-
public record Minister(String name, @FixedString(size = 128) String imageFileName, float loyalty, int startDate, int deathDate) {
7+
public record Minister(String name, @FixedString(length = 128) String imageFileName, float loyalty, int startDate, int deathDate) {
88
}

src/main/java/com/github/elebras1/flecs/annotation/FixedString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
@Retention(RetentionPolicy.SOURCE)
99
@Target(ElementType.RECORD_COMPONENT)
1010
public @interface FixedString {
11-
int size();
11+
int length();
1212
}

src/main/java/com/github/elebras1/flecs/processor/AbstractGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected String getGetterMethod(String type) {
4444
protected int getStringSize(VariableElement field) {
4545
FixedString annotation = field.getAnnotation(FixedString.class);
4646
if (annotation != null) {
47-
int size = annotation.size();
47+
int size = annotation.length();
4848
if ((size & (size - 1)) != 0) {
4949
throw new IllegalArgumentException("Field '" + field.getSimpleName() + "': @FixedString size must be a power of 2. Got: " + size);
5050
}

0 commit comments

Comments
 (0)