Browse Source

jfinal 3.4

James 7 years ago
parent
commit
a7d08d00c7

+ 8 - 0
src/main/java/com/jfinal/template/ext/extensionmethod/ByteExt.java

@@ -43,6 +43,14 @@ public class ByteExt {
 	public Double toDouble(Byte self) {
 		return self.doubleValue();
 	}
+	
+	public Short toShort(Byte self) {
+		return self.shortValue();
+	}
+	
+	public Byte toByte(Byte self) {
+		return self;
+	}
 }
 
 

+ 8 - 0
src/main/java/com/jfinal/template/ext/extensionmethod/DoubleExt.java

@@ -43,6 +43,14 @@ public class DoubleExt {
 	public Double toDouble(Double self) {
 		return self;
 	}
+	
+	public Short toShort(Double self) {
+		return self.shortValue();
+	}
+	
+	public Byte toByte(Double self) {
+		return self.byteValue();
+	}
 }
 
 

+ 8 - 0
src/main/java/com/jfinal/template/ext/extensionmethod/FloatExt.java

@@ -43,6 +43,14 @@ public class FloatExt {
 	public Double toDouble(Float self) {
 		return self.doubleValue();
 	}
+	
+	public Short toShort(Float self) {
+		return self.shortValue();
+	}
+	
+	public Byte toByte(Float self) {
+		return self.byteValue();
+	}
 }
 
 

+ 8 - 0
src/main/java/com/jfinal/template/ext/extensionmethod/IntegerExt.java

@@ -63,6 +63,14 @@ public class IntegerExt {
 	public Double toDouble(Integer self) {
 		return self.doubleValue();
 	}
+	
+	public Short toShort(Integer self) {
+		return self.shortValue();
+	}
+	
+	public Byte toByte(Integer self) {
+		return self.byteValue();
+	}
 }
 
 

+ 8 - 0
src/main/java/com/jfinal/template/ext/extensionmethod/LongExt.java

@@ -43,6 +43,14 @@ public class LongExt {
 	public Double toDouble(Long self) {
 		return self.doubleValue();
 	}
+	
+	public Short toShort(Long self) {
+		return self.shortValue();
+	}
+	
+	public Byte toByte(Long self) {
+		return self.byteValue();
+	}
 }
 
 

+ 8 - 0
src/main/java/com/jfinal/template/ext/extensionmethod/ShortExt.java

@@ -43,6 +43,14 @@ public class ShortExt {
 	public Double toDouble(Short self) {
 		return self.doubleValue();
 	}
+	
+	public Short toShort(Short self) {
+		return self;
+	}
+	
+	public Byte toByte(Short self) {
+		return self.byteValue();
+	}
 }
 
 

+ 8 - 0
src/main/java/com/jfinal/template/ext/extensionmethod/StringExt.java

@@ -79,6 +79,14 @@ public class StringExt {
 	public Double toDouble(String self) {
 		return StrKit.isBlank(self) ? null : Double.parseDouble(self);
 	}
+	
+	public Short toShort(String self) {
+		return StrKit.isBlank(self) ? null : Short.parseShort(self);
+	}
+	
+	public Byte toByte(String self) {
+		return StrKit.isBlank(self) ? null : Byte.parseByte(self);
+	}
 }