1 15 package org.apache.hivemind; 16 17 import org.apache.hivemind.impl.MessageFormatter; 18 import org.apache.hivemind.service.ClassFabUtils; 19 20 25 public class HiveMindMessages 26 { 27 protected static MessageFormatter _formatter = new MessageFormatter(HiveMindMessages.class); 28 29 public static String unimplementedMethod(Object instance, String methodName) 30 { 31 return _formatter.format("unimplemented-method", instance.getClass().getName(), methodName); 32 } 33 34 public static String registryShutdown() 35 { 36 return _formatter.getMessage("registry-shutdown"); 37 } 38 39 public static String unknownLocation() 40 { 41 return _formatter.getMessage("unknown-location"); 42 } 43 44 45 public static String paramNotNull(String parameterName) 46 { 47 return _formatter.format("param-not-null", parameterName); 48 } 49 50 public static String fieldNotNull(String fieldName) 51 { 52 return _formatter.format("field-not-null", fieldName); 53 } 54 55 56 public static String paramWrongType(String parameterName, Object parameter, Class expectedType) 57 { 58 return _formatter.format("param-wrong-type", parameterName, ClassFabUtils 59 .getJavaClassName(parameter.getClass()), ClassFabUtils 60 .getJavaClassName(expectedType)); 61 } 62 } | Popular Tags |