webit.script.resolvers.impl.LongOutResolver Maven / Gradle / Ivy
// Copyright (c) 2013, Webit Team. All Rights Reserved.
package webit.script.resolvers.impl;
import webit.script.io.Out;
import webit.script.resolvers.MatchMode;
import webit.script.resolvers.OutResolver;
import webit.script.util.NumberUtil;
/**
*
* @author zqq90
*/
public class LongOutResolver implements OutResolver {
public void render(final Out out, Object bean) {
final long i;
if ((i = ((Long) bean).longValue()) != Long.MIN_VALUE) {
final char[] buf;
final int pos = NumberUtil.getChars(i, NumberUtil.SIZE, (buf = NumberUtil.get()));
out.write(buf, pos, NumberUtil.SIZE - pos);
return;
} else {
out.write("-9223372036854775808");
return;
}
}
public MatchMode getMatchMode() {
return MatchMode.EQUALS;
}
public Class> getMatchClass() {
return Long.class;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy