IntegerCodec.java
package com.hypixel.hytale.codec.codecs.simple;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.ExtraInfo;
import com.hypixel.hytale.codec.PrimitiveCodec;
import com.hypixel.hytale.codec.RawJsonCodec;
import com.hypixel.hytale.codec.schema.SchemaContext;
import com.hypixel.hytale.codec.schema.config.IntegerSchema;
import com.hypixel.hytale.codec.schema.config.Schema;
import com.hypixel.hytale.codec.util.RawJsonReader;
import java.io.IOException;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.bson.BsonInt32;
import org.bson.BsonValue;
public class IntegerCodec implements Codec<Integer>, RawJsonCodec<Integer>, PrimitiveCodec {
public IntegerCodec() {
}
@Nonnull
public Integer decode(@Nonnull BsonValue bsonValue, ExtraInfo extraInfo) {
int intValue = bsonValue.asNumber().intValue();
if ((double)intValue != bsonValue.asNumber().doubleValue()) {
throw new IllegalArgumentException();
} {
intValue;
}
}
BsonValue {
(t);
}
Integer IOException {
reader.readIntValue();
}
Schema {
();
}
Schema {
();
(def != ) {
s.setDefault(def);
}
s;
}
}