< prev index next > src/java.base/share/classes/java/lang/Long.java
Print this page
import java.math.*;
import java.util.Objects;
import java.util.Optional;
import jdk.internal.misc.CDS;
+ import jdk.internal.value.DeserializeConstructor;
import jdk.internal.util.DecimalDigits;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.internal.vm.annotation.Stable;
* @author Arthur van Hoff
* @author Josh Bloch
* @author Joseph D. Darcy
* @since 1.0
*/
+ @jdk.internal.MigratedValueClass
@jdk.internal.ValueBased
public final class Long extends Number
implements Comparable<Long>, Constable, ConstantDesc {
/**
* A constant holding the minimum value a {@code long} can
* @param l a long value.
* @return a {@code Long} instance representing {@code l}.
* @since 1.5
*/
@IntrinsicCandidate
+ @DeserializeConstructor
public static Long valueOf(long l) {
final int offset = 128;
if (l >= -128 && l <= 127) { // will cache
return LongCache.cache[(int)l + offset];
}
< prev index next >