Index: lutingenerator/src/java/org/codelutin/generator/Util.java diff -u lutingenerator/src/java/org/codelutin/generator/Util.java:1.24 lutingenerator/src/java/org/codelutin/generator/Util.java:1.25 --- lutingenerator/src/java/org/codelutin/generator/Util.java:1.24 Wed Dec 14 18:47:32 2005 +++ lutingenerator/src/java/org/codelutin/generator/Util.java Mon Dec 19 18:38:27 2005 @@ -17,7 +17,7 @@ *@author Benjamin Poussin * * Copyright Code Lutin - *@version $Revision: 1.24 $ Mise a jour: $Date: 2005/12/14 18:47:32 $ par : + *@version $Revision: 1.25 $ Mise a jour: $Date: 2005/12/19 18:38:27 $ par : * $Author: thimel $ */ @@ -160,7 +160,7 @@ if ("java.lang.Date".equals(type)) return null; return null; } - + public static String getCastValue(String type, String o){ if ("byte".equals(type)) return "((Byte)"+o+").byteValue()"; if ("short".equals(type)) return "((Short)"+o+").shortValue()"; @@ -174,6 +174,19 @@ return "(" + type + ")" + o; } + public static String getHashCodeExpression(String type, String o){ + String result = o; + if ("byte".equals(type)) result = "new Byte("+o+")"; + if ("short".equals(type)) result = "new Short("+o+")"; + if ("int".equals(type)) result = "new Integer("+o+")"; + if ("long".equals(type)) result = "new Long("+o+")"; + if ("float".equals(type)) result = "new Float("+o+")"; + if ("double".equals(type)) result = "new Double("+o+")"; + if ("char".equals(type)) result = "new Character("+o+")"; + if ("boolean".equals(type)) result = "new Boolean("+o+")"; + return result +".hashCode()"; + } + /** * Retourne la chaine de caractere dont on a besoin pour la declaration * des parametres d'une methode.