1 10 package org.mmbase.datatypes; 11 import org.mmbase.util.Casting; 12 13 21 public class LongDataType extends NumberDataType { 22 private static final long serialVersionUID = 1L; 26 public LongDataType(String name, boolean primitive) { 27 super(name, primitive ? Long.TYPE : Long .class); 28 setMin(new Long (Long.MIN_VALUE), true); 29 minRestriction.setEnforceStrength(ENFORCE_ABSOLUTE); 30 setMax(new Long (Long.MAX_VALUE), true); 31 maxRestriction.setEnforceStrength(ENFORCE_ABSOLUTE); 32 } 33 34 35 38 public long getMin() { 39 Object min = getMinRestriction().getValue(); 40 return min == null ? Long.MIN_VALUE : Casting.toLong(min); } 42 43 46 public long getMax() { 47 Object max = getMaxRestriction().getValue(); 48 return max == null ? Long.MAX_VALUE : Casting.toLong(max); } 50 51 } 52 | Popular Tags |