Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add four new fields to ClassUsage #182

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/org/mikeneck/graalvm/GraalVmVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ public enum GraalVmVersion {
GRAAL_21_1_0_JAVA_8("21.1.0-java8", new GraalVm21Matcher("21.1.0", "java8")),
GRAAL_21_1_0_JAVA_11("21.1.0-java11", new GraalVm21Matcher("21.1.0", "java11")),
GRAAL_21_1_0_JAVA_16("21.1.0-java16", new GraalVm21Matcher("21.1.0", "java16")),
GRAAL_20_3_3_JAVA_8("20.3.3-java8", new GraalVm20Matcher("20.3.3", "java8")),
GRAAL_20_3_3_JAVA_11("20.3.3-java11", new GraalVm20Matcher("20.3.3", "java11")),
GRAAL_21_2_0_JAVA_8("21.2.0-java8", new GraalVm21Matcher("21.2.0", "java8")),
GRAAL_21_2_0_JAVA_11("21.2.0-java11", new GraalVm21Matcher("21.2.0", "java11")),
GRAAL_21_2_0_JAVA_16("21.2.0-java16", new GraalVm21Matcher("21.2.0", "java16")),
GRAAL_21_3_0_JAVA_8("21.3.0-java8", new GraalVm21Matcher("21.3.0", "java8")),
GRAAL_21_3_0_JAVA_11("21.3.0-java11", new GraalVm21Matcher("21.3.0", "java11")),
GRAAL_21_3_0_JAVA_16("21.3.0-java16", new GraalVm21Matcher("21.3.0", "java16")),
GRAAL_20_3_4_JAVA_8("20.3.4-java8", new GraalVm20Matcher("20.3.4", "java8")),
GRAAL_20_3_4_JAVA_11("20.3.4-java11", new GraalVm20Matcher("20.3.4", "java11")),
;

@NotNull final String version;
Expand Down
48 changes: 44 additions & 4 deletions src/main/java/org/mikeneck/graalvm/config/ClassUsage.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ public class ClassUsage implements Comparable<ClassUsage>, MergeableConfig<Class
@JsonInclude(JsonInclude.Include.NON_NULL)
public Boolean allPublicClasses;

@Nullable
@JsonInclude(JsonInclude.Include.NON_NULL)
public Boolean queryAllDeclaredConstructors;

@Nullable
@JsonInclude(JsonInclude.Include.NON_NULL)
public Boolean queryAllPublicConstructors;

@Nullable
@JsonInclude(JsonInclude.Include.NON_NULL)
public Boolean queryAllDeclaredMethods;

@Nullable
@JsonInclude(JsonInclude.Include.NON_NULL)
public Boolean queryAllPublicMethods;

@SuppressWarnings("unused")
public ClassUsage() {}

Expand All @@ -71,7 +87,11 @@ private ClassUsage(
@Nullable Boolean allPublicConstructors,
@Nullable Boolean allPublicFields,
@Nullable Boolean allDeclaredClasses,
@Nullable Boolean allPublicClasses) {
@Nullable Boolean allPublicClasses,
@Nullable Boolean queryAllDeclaredConstructors,
@Nullable Boolean queryAllPublicConstructors,
@Nullable Boolean queryAllDeclaredMethods,
@Nullable Boolean queryAllPublicMethods) {
this.name = name;
this.methods = methods;
this.fields = fields;
Expand All @@ -83,6 +103,10 @@ private ClassUsage(
this.allPublicFields = allPublicFields;
this.allDeclaredClasses = allDeclaredClasses;
this.allPublicClasses = allPublicClasses;
this.queryAllDeclaredConstructors = queryAllDeclaredConstructors;
this.queryAllPublicConstructors = queryAllPublicConstructors;
this.queryAllDeclaredMethods = queryAllDeclaredMethods;
this.queryAllPublicMethods = queryAllPublicMethods;
}

public ClassUsage(
Expand Down Expand Up @@ -180,7 +204,11 @@ public boolean equals(Object o) {
&& Objects.equals(allPublicConstructors, that.allPublicConstructors)
&& Objects.equals(allPublicFields, that.allPublicFields)
&& Objects.equals(allDeclaredClasses, that.allDeclaredClasses)
&& Objects.equals(allPublicClasses, that.allPublicClasses);
&& Objects.equals(allPublicClasses, that.allPublicClasses)
&& Objects.equals(queryAllDeclaredConstructors, that.queryAllDeclaredConstructors)
&& Objects.equals(queryAllPublicConstructors, that.queryAllPublicConstructors)
&& Objects.equals(queryAllDeclaredMethods, that.queryAllDeclaredMethods)
&& Objects.equals(queryAllPublicMethods, that.queryAllPublicMethods);
}

@Override
Expand All @@ -196,7 +224,11 @@ public int hashCode() {
allPublicConstructors,
allPublicFields,
allDeclaredClasses,
allPublicClasses);
allPublicClasses,
queryAllDeclaredConstructors,
queryAllPublicConstructors,
queryAllDeclaredMethods,
queryAllPublicMethods);
}

@SuppressWarnings("StringBufferReplaceableByString")
Expand All @@ -214,6 +246,10 @@ public String toString() {
sb.append(", allPublicFields=").append(allPublicFields);
sb.append(", allDeclaredClasses=").append(allDeclaredClasses);
sb.append(", allPublicClasses=").append(allPublicClasses);
sb.append(", queryAllDeclaredConstructors=").append(queryAllDeclaredConstructors);
sb.append(", queryAllPublicConstructors=").append(queryAllPublicConstructors);
sb.append(", queryAllDeclaredMethods=").append(queryAllDeclaredMethods);
sb.append(", queryAllPublicMethods=").append(queryAllPublicMethods);
sb.append('}');
return sb.toString();
}
Expand Down Expand Up @@ -243,6 +279,10 @@ public ClassUsage mergeWith(ClassUsage other) {
BooleanMergeable.mergeBoolean(this.allPublicConstructors, other.allPublicConstructors),
BooleanMergeable.mergeBoolean(this.allPublicFields, other.allPublicFields),
BooleanMergeable.mergeBoolean(this.allDeclaredClasses, other.allDeclaredClasses),
BooleanMergeable.mergeBoolean(this.allPublicClasses, other.allPublicClasses));
BooleanMergeable.mergeBoolean(this.allPublicClasses, other.allPublicClasses),
BooleanMergeable.mergeBoolean(this.queryAllDeclaredConstructors, other.queryAllDeclaredConstructors),
BooleanMergeable.mergeBoolean(this.queryAllPublicConstructors, other.queryAllPublicConstructors),
BooleanMergeable.mergeBoolean(this.queryAllDeclaredMethods, other.queryAllDeclaredMethods),
BooleanMergeable.mergeBoolean(this.queryAllPublicMethods, other.queryAllPublicMethods));
}
}