/** * Get the name of the class without the package. * * @param aClass * The class to get the information from. May not be <code>null</code>. * @return The local name of the passed class. */ @Nonnull public static String getClassLocalName (@Nonnull final Class <?> aClass) { ValueEnforcer.notNull (aClass, "Class"); return getClassLocalName (aClass.getName ()); }
public Duration convertDataValueToObjectValue (final Object aDataValue, final Session session) { if (aDataValue != null) try { return new Duration (((Timestamp) aDataValue).getTime ()); } catch (final IllegalArgumentException ex) { // failed to convert s_aLogger.warn ("Failed to convert '" + aDataValue + "' of type " + CGStringHelper.getSafeClassName (aDataValue) + "to Duration!"); } return null; }
/** * Get the name of the package the passed class resides in. * * @param aClass * The class to get the information from. May not be <code>null</code>. * @return The package name of the passed class. */ @Nonnull public static String getClassPackageName (@Nonnull final Class <?> aClass) { ValueEnforcer.notNull (aClass, "Class"); return getClassPackageName (aClass.getName ()); }
/** * Convert a package name to a relative directory name. * * @param sPackage * The name of the package to be converted. May not be * <code>null</code>. * @return The directory name using forward slashes (/) instead of the dots. */ @Nonnull public static String getDirectoryFromPackage (@Nonnull final String sPackage) { // No differentiation return getPathFromClass (sPackage); }
/** * Convert a package name to a relative directory name. * * @param aPackage * The package to be converted. May not be <code>null</code>. * @return The directory name using forward slashes (/) instead of the dots. */ @Nonnull public static String getDirectoryFromPackage (@Nonnull final Package aPackage) { ValueEnforcer.notNull (aPackage, "Package"); // No differentiation return getPathFromClass (aPackage.getName ()); }
/** * Get the name of the object's class without the package. * * @param aObject * The object to get the information from. May not be <code>null</code> * . * @return The local name of the passed object's class. */ @Nonnull public static String getClassLocalName (@Nonnull final Object aObject) { ValueEnforcer.notNull (aObject, "Object"); return getClassLocalName (aObject.getClass ()); }
@Override public boolean equals (final Object o) { if (o == this) return true; if (!super.equals (o)) return false; final JPAExecutionResult <?> rhs = (JPAExecutionResult <?>) o; return EqualsUtils.equals (CGStringHelper.getSafeClassName (m_aThrowable), CGStringHelper.getSafeClassName (rhs.m_aThrowable)); }
/** * Get the path representation of the passed class. The path representation is * achieved by replacing all dots (.) with forward slashes (/) in the class * name. * * @param aClass * The class of which the path is to be retrieved. May not be * <code>null</code>. * @return The path representation. Never <code>null</code>. */ @Nonnull public static String getPathFromClass (@Nonnull final Class <?> aClass) { ValueEnforcer.notNull (aClass, "Class"); return getPathFromClass (aClass.getName ()); }
@Nonnull @Nonempty protected String getStatisticsName (@Nonnull final JobExecutionContext aContext) { return "quartz." + CGStringHelper.getClassLocalName (aContext.getJobDetail ().getJobClass ()); }
public LocalDate convertDataValueToObjectValue (final Object aDataValue, final Session session) { if (aDataValue != null) try { return new LocalDate (aDataValue, PDTConfig.getDefaultChronology ()); } catch (final IllegalArgumentException ex) { // failed to convert s_aLogger.warn ("Failed to convert '" + aDataValue + "' of type " + CGStringHelper.getSafeClassName (aDataValue) + " to LocalDate!"); } return null; }
@Nonnull @Nonempty protected String getJobName (@Nonnull final JobExecutionContext aContext) { return CGStringHelper.getClassLocalName (aContext.getJobDetail ().getJobClass ()); }
public Locale convertDataValueToObjectValue (final Object aDataValue, final Session session) { if (aDataValue != null) try { return LocaleCache.getLocale ((String) aDataValue); } catch (final Exception ex) { // failed to convert s_aLogger.warn ("Failed to convert '" + aDataValue + "' of type " + CGStringHelper.getSafeClassName (aDataValue) + "to Locale!"); } return null; }
/** * Create a standard {@link ObjectName} using the default domain and only the * "type" property. The type property is the class local name of the specified * object. * * @param aObj * The object from which the name is to be created. * @return The non-<code>null</code> {@link ObjectName}. */ @Nonnull public static ObjectName createWithDefaultProperties (@Nonnull final Object aObj) { ValueEnforcer.notNull (aObj, "Object"); final Hashtable <String, String> aParams = new Hashtable <String, String> (); aParams.put (CJMX.PROPERTY_TYPE, CGStringHelper.getClassLocalName (aObj)); return create (aParams); }
public DateTime convertDataValueToObjectValue (final Object aDataValue, final Session session) { if (aDataValue != null) try { return new DateTime (aDataValue, PDTConfig.getDefaultChronology ()); } catch (final RuntimeException ex) { // failed to convert s_aLogger.warn ("Failed to convert '" + aDataValue + "' of type " + CGStringHelper.getSafeClassName (aDataValue) + " to DateTime!"); } return null; }
public SessionApplicationScope (@Nonnull @Nonempty final String sScopeID) { super (sScopeID); if (ScopeUtils.debugSessionApplicationScopeLifeCycle (s_aLogger)) s_aLogger.info ("Created session application scope '" + sScopeID + "' of class " + CGStringHelper.getClassLocalName (this), ScopeUtils.getDebugStackTrace ()); }
public LocalDateTime convertDataValueToObjectValue (final Object aDataValue, final Session session) { if (aDataValue != null) try { return new LocalDateTime (aDataValue, PDTConfig.getDefaultChronology ()); } catch (final RuntimeException ex) { // failed to convert s_aLogger.warn ("Failed to convert '" + aDataValue + "' of type " + CGStringHelper.getSafeClassName (aDataValue) + " to LocalDateTime!"); } return null; }
/** * Create a new application web scope with the given ID. * * @param sScopeID * The scope ID to be used. May neither be <code>null</code> nor empty. */ public ApplicationScope (@Nonnull @Nonempty final String sScopeID) { super (sScopeID); if (ScopeUtils.debugApplicationScopeLifeCycle (s_aLogger)) s_aLogger.info ("Created application scope '" + sScopeID + "' of class " + CGStringHelper.getClassLocalName (this), ScopeUtils.getDebugStackTrace ()); }
public LocalTime convertDataValueToObjectValue (final Object aDataValue, final Session session) { if (aDataValue != null) try { return new LocalTime (aDataValue, PDTConfig.getDefaultChronology ()); } catch (final IllegalArgumentException ex) { // failed to convert s_aLogger.warn ("Failed to convert '" + aDataValue + "' of type " + CGStringHelper.getSafeClassName (aDataValue) + "to LocalTime!"); } return null; }
@Override protected void postDestroy () { if (ScopeUtils.debugSessionScopeLifeCycle (s_aLogger)) s_aLogger.info ("Destroyed session scope '" + getID () + "' of class " + CGStringHelper.getClassLocalName (this), ScopeUtils.getDebugStackTrace ()); }
aRef + " - " + CGStringHelper.getSafeClassName (aRef)); CGStringHelper.getSafeClassName (aColumnElement));