first commit
Build AsminVoicechat / prepare-release (push) Successful in 14s
Build AsminVoicechat / build-and-test (17) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (18) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (19) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (20) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (21) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (22) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (23) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (24) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (25) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (26) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (27-ea) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (16) (push) Canceled after 38s
Build AsminVoicechat / prepare-release (push) Successful in 14s
Build AsminVoicechat / build-and-test (17) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (18) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (19) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (20) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (21) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (22) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (23) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (24) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (25) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (26) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (27-ea) (push) Canceled after 0s
Build AsminVoicechat / build-and-test (16) (push) Canceled after 38s
This commit is contained in:
commit
bbccd4a815
454 files changed
+45050
No files matched your search
+134
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.Config;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.ConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public abstract class AbstractConfigEntry<T>
|
||||
implements ConfigEntry<T> {
|
||||
protected final CommentedPropertyConfig config;
|
||||
protected final ValueSerializer<T> serializer;
|
||||
protected String[] comments;
|
||||
protected String key;
|
||||
protected T def;
|
||||
@Nullable
|
||||
protected T value;
|
||||
|
||||
public AbstractConfigEntry(CommentedPropertyConfig config, ValueSerializer<T> serializer, String[] comments, String key, T def) {
|
||||
Objects.requireNonNull(config);
|
||||
Objects.requireNonNull(serializer);
|
||||
Objects.requireNonNull(comments);
|
||||
Objects.requireNonNull(key);
|
||||
Objects.requireNonNull(def);
|
||||
this.config = config;
|
||||
this.serializer = serializer;
|
||||
this.comments = comments;
|
||||
this.key = key;
|
||||
this.def = def;
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
if (this.config.getProperties().containsKey(this.key)) {
|
||||
T val = this.serializer.deserialize(this.config.getProperties().get(this.key));
|
||||
if (val == null) {
|
||||
this.reset();
|
||||
} else {
|
||||
this.value = this.fixValue(val);
|
||||
this.syncEntryToProperties();
|
||||
}
|
||||
} else {
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public T get() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractConfigEntry<T> set(T value) {
|
||||
if (this.value != null && this.value.equals(value)) {
|
||||
return this;
|
||||
}
|
||||
this.value = this.fixValue(value);
|
||||
this.syncEntryToProperties();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractConfigEntry<T> comment(String ... comments) {
|
||||
this.comments = comments;
|
||||
this.syncEntryToProperties();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getComments() {
|
||||
return this.comments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigEntry<T> reset() {
|
||||
this.value = this.def;
|
||||
this.syncEntryToProperties();
|
||||
return this;
|
||||
}
|
||||
|
||||
private void syncEntryToProperties() {
|
||||
String serialized = this.serializer.serialize(this.value);
|
||||
if (serialized == null) {
|
||||
if (this.value == this.def) {
|
||||
throw new IllegalStateException("Failed to serialize default value");
|
||||
}
|
||||
this.reset();
|
||||
return;
|
||||
}
|
||||
this.config.getProperties().set(this.key, serialized, this.comments);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigEntry<T> save() {
|
||||
this.config.save();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigEntry<T> saveSync() {
|
||||
this.config.saveSync();
|
||||
return this;
|
||||
}
|
||||
|
||||
T fixValue(T value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T getDefault() {
|
||||
return this.def;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Config getConfig() {
|
||||
return this.config;
|
||||
}
|
||||
|
||||
public ValueSerializer<T> getSerializer() {
|
||||
return this.serializer;
|
||||
}
|
||||
}
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nonnull
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.AbstractConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.RangedConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public abstract class AbstractRangedConfigEntry<T>
|
||||
extends AbstractConfigEntry<T>
|
||||
implements RangedConfigEntry<T> {
|
||||
@Nonnull
|
||||
protected final T min;
|
||||
@Nonnull
|
||||
protected final T max;
|
||||
|
||||
public AbstractRangedConfigEntry(CommentedPropertyConfig config, ValueSerializer<T> serializer, String[] comments, String key, T def, @Nullable T min, @Nullable T max) {
|
||||
super(config, serializer, comments, key, def);
|
||||
this.min = min != null ? min : this.minimumPossibleValue();
|
||||
this.max = max != null ? max : this.maximumPossibleValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public T getMin() {
|
||||
return this.min;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public T getMax() {
|
||||
return this.max;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
abstract T minimumPossibleValue();
|
||||
|
||||
@Nonnull
|
||||
abstract T maximumPossibleValue();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.AbstractConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
|
||||
public class BooleanConfigEntry
|
||||
extends AbstractConfigEntry<Boolean> {
|
||||
public BooleanConfigEntry(CommentedPropertyConfig config, ValueSerializer<Boolean> serializer, String[] comments, String key, Boolean def) {
|
||||
super(config, serializer, comments, key, def);
|
||||
this.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.Config;
|
||||
|
||||
public interface ConfigEntry<T> {
|
||||
public ConfigEntry<T> comment(String ... var1);
|
||||
|
||||
public String[] getComments();
|
||||
|
||||
public T get();
|
||||
|
||||
public ConfigEntry<T> set(T var1);
|
||||
|
||||
public String getKey();
|
||||
|
||||
public ConfigEntry<T> reset();
|
||||
|
||||
public ConfigEntry<T> save();
|
||||
|
||||
public ConfigEntry<T> saveSync();
|
||||
|
||||
public T getDefault();
|
||||
|
||||
public Config getConfig();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nonnull
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.AbstractRangedConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class DoubleConfigEntry
|
||||
extends AbstractRangedConfigEntry<Double> {
|
||||
public DoubleConfigEntry(CommentedPropertyConfig config, ValueSerializer<Double> serializer, String[] comments, String key, Double def, @Nullable Double min, @Nullable Double max) {
|
||||
super(config, serializer, comments, key, def, min, max);
|
||||
this.reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
Double minimumPossibleValue() {
|
||||
return Double.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
Double maximumPossibleValue() {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
Double fixValue(Double value) {
|
||||
return Math.max(Math.min(value, (Double)this.max), (Double)this.min);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.AbstractConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
|
||||
public class EnumConfigEntry<E extends Enum<E>>
|
||||
extends AbstractConfigEntry<E> {
|
||||
public EnumConfigEntry(CommentedPropertyConfig config, ValueSerializer<E> serializer, String[] comments, String key, E def) {
|
||||
super(config, serializer, comments, key, def);
|
||||
this.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nonnull
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.AbstractRangedConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class FloatConfigEntry
|
||||
extends AbstractRangedConfigEntry<Float> {
|
||||
public FloatConfigEntry(CommentedPropertyConfig config, ValueSerializer<Float> serializer, String[] comments, String key, Float def, @Nullable Float min, @Nullable Float max) {
|
||||
super(config, serializer, comments, key, def, min, max);
|
||||
this.reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
Float minimumPossibleValue() {
|
||||
return Float.valueOf(Float.MIN_VALUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
Float maximumPossibleValue() {
|
||||
return Float.valueOf(Float.MAX_VALUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
Float fixValue(Float value) {
|
||||
return Float.valueOf(Math.max(Math.min(value.floatValue(), ((Float)this.max).floatValue()), ((Float)this.min).floatValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.AbstractConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
|
||||
public class GenericConfigEntry<T>
|
||||
extends AbstractConfigEntry<T> {
|
||||
public GenericConfigEntry(CommentedPropertyConfig config, ValueSerializer<T> serializer, String[] comments, String key, T def) {
|
||||
super(config, serializer, comments, key, def);
|
||||
this.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nonnull
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.AbstractRangedConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class IntegerConfigEntry
|
||||
extends AbstractRangedConfigEntry<Integer> {
|
||||
public IntegerConfigEntry(CommentedPropertyConfig config, ValueSerializer<Integer> serializer, String[] comments, String key, Integer def, @Nullable Integer min, @Nullable Integer max) {
|
||||
super(config, serializer, comments, key, def, min, max);
|
||||
this.reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
Integer minimumPossibleValue() {
|
||||
return Integer.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
Integer maximumPossibleValue() {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
Integer fixValue(Integer value) {
|
||||
return Math.max(Math.min(value, (Integer)this.max), (Integer)this.min);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nonnull
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.AbstractRangedConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class LongConfigEntry
|
||||
extends AbstractRangedConfigEntry<Long> {
|
||||
public LongConfigEntry(CommentedPropertyConfig config, ValueSerializer<Long> serializer, String[] comments, String key, Long def, @Nullable Long min, @Nullable Long max) {
|
||||
super(config, serializer, comments, key, def, min, max);
|
||||
this.reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
Long minimumPossibleValue() {
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
Long maximumPossibleValue() {
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
Long fixValue(Long value) {
|
||||
return Math.max(Math.min(value, (Long)this.max), (Long)this.min);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nonnull
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.ConfigEntry;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface RangedConfigEntry<T>
|
||||
extends ConfigEntry<T> {
|
||||
@Nonnull
|
||||
public T getMin();
|
||||
|
||||
@Nonnull
|
||||
public T getMax();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.CommentedPropertyConfig;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.AbstractConfigEntry;
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
|
||||
public class StringConfigEntry
|
||||
extends AbstractConfigEntry<String> {
|
||||
public StringConfigEntry(CommentedPropertyConfig config, ValueSerializer<String> serializer, String[] comments, String key, String def) {
|
||||
super(config, serializer, comments, key, def);
|
||||
this.reload();
|
||||
}
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry.serializer;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BooleanSerializer
|
||||
implements ValueSerializer<Boolean> {
|
||||
public static final BooleanSerializer INSTANCE = new BooleanSerializer();
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Boolean deserialize(String str) {
|
||||
return Boolean.valueOf(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String serialize(Boolean val) {
|
||||
return String.valueOf(val);
|
||||
}
|
||||
}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry.serializer;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class DoubleSerializer
|
||||
implements ValueSerializer<Double> {
|
||||
public static final DoubleSerializer INSTANCE = new DoubleSerializer();
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Double deserialize(String str) {
|
||||
try {
|
||||
return Double.parseDouble(str);
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String serialize(Double val) {
|
||||
return String.valueOf(val);
|
||||
}
|
||||
}
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry.serializer;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class EnumSerializer<E extends Enum<E>>
|
||||
implements ValueSerializer<E> {
|
||||
protected Class<E> enumClass;
|
||||
|
||||
public EnumSerializer(Class<E> enumClass) {
|
||||
this.enumClass = enumClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public E deserialize(String str) {
|
||||
try {
|
||||
return Enum.valueOf(this.enumClass, str);
|
||||
}
|
||||
catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String serialize(E val) {
|
||||
return ((Enum)val).name();
|
||||
}
|
||||
}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry.serializer;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class FloatSerializer
|
||||
implements ValueSerializer<Float> {
|
||||
public static final FloatSerializer INSTANCE = new FloatSerializer();
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Float deserialize(String str) {
|
||||
try {
|
||||
return Float.valueOf(Float.parseFloat(str));
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String serialize(Float val) {
|
||||
return String.valueOf(val);
|
||||
}
|
||||
}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry.serializer;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class IntegerSerializer
|
||||
implements ValueSerializer<Integer> {
|
||||
public static final IntegerSerializer INSTANCE = new IntegerSerializer();
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Integer deserialize(String str) {
|
||||
try {
|
||||
return Integer.parseInt(str);
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String serialize(Integer val) {
|
||||
return String.valueOf(val);
|
||||
}
|
||||
}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry.serializer;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class LongSerializer
|
||||
implements ValueSerializer<Long> {
|
||||
public static final LongSerializer INSTANCE = new LongSerializer();
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Long deserialize(String str) {
|
||||
try {
|
||||
return Long.parseLong(str);
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String serialize(Long val) {
|
||||
return String.valueOf(val);
|
||||
}
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry.serializer;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class StringSerializer
|
||||
implements ValueSerializer<String> {
|
||||
public static final StringSerializer INSTANCE = new StringSerializer();
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String deserialize(String str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String serialize(String val) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry.serializer;
|
||||
|
||||
import de.maxhenkel.voicechat.configbuilder.entry.serializer.ValueSerializer;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(value=RetentionPolicy.RUNTIME)
|
||||
@Target(value={ElementType.TYPE})
|
||||
public @interface ValueSerializable {
|
||||
public Class<? extends ValueSerializer<?>> value();
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.annotation.Nullable
|
||||
*/
|
||||
package de.maxhenkel.voicechat.configbuilder.entry.serializer;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public interface ValueSerializer<T> {
|
||||
@Nullable
|
||||
public T deserialize(String var1);
|
||||
|
||||
@Nullable
|
||||
public String serialize(T var1);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user