org.dominokit.jacksonapt.deser.array.cast.JsIntegerArrayReader Maven / Gradle / Ivy
The newest version!
package org.dominokit.jacksonapt.deser.array.cast;
import elemental2.core.JsArray;
import elemental2.core.JsNumber;
import jsinterop.base.Js;
import org.dominokit.jacksonapt.JacksonContext;
import org.dominokit.jacksonapt.stream.JsonReader;
/**
* JsIntegerArrayReader class.
*
* @author vegegoku
* @version $Id: $Id
*/
public class JsIntegerArrayReader extends BaseJsNumberArrayReader implements JacksonContext.IntegerArrayReader {
/** {@inheritDoc} */
@Override
public int[] readArray(JsonReader reader) {
return reinterpretCast(super.readNumberArray(reader));
}
private static int[] reinterpretCast(JsArray value) {
JsArray sliced = value.slice();
return Js.uncheckedCast(sliced);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy