@Override public String getMessage () { return "Invalid Character 0x" + StringHelper.getHexStringLeadingZero (m_nInput, 2) + "(" + (char) m_nInput + ")"; } }
public ToStringGenerator (@Nullable final Object aSrc) { if (aSrc != null) { final String sClassName = aSrc.getClass ().getName (); final int nIndex = sClassName.lastIndexOf ('.'); m_aSB.append (nIndex == -1 ? sClassName : sClassName.substring (nIndex + 1)) .append ("@0x") .append (StringHelper.getHexStringLeadingZero (System.identityHashCode (aSrc), 8)); } m_aSrc = aSrc; }
@Nonnull private static String _getAsString (@Nonnull final Set <Character> aInvalidChars) { if (ContainerHelper.isEmpty (aInvalidChars)) return "NONE"; final StringBuilder aSB = new StringBuilder (); for (final Character aChar : aInvalidChars) { if (aSB.length () > 0) aSB.append (", "); final int nChar = aChar.charValue (); aSB.append ("0x").append (StringHelper.getHexStringLeadingZero (nChar, 2)); } return aSB.toString (); }
@Override public String toString () { return new ToStringGenerator (this).append ("name", m_sEntityName) .append ("char", "0x" + StringHelper.getHexStringLeadingZero (m_cChar, 4)) .append ("description", m_sDescription) .toString (); }
/** * Get the hex representation of the passed object's address. Note that this * method makes no differentiation between 32 and 64 bit architectures. The * result is always a hexadecimal value preceded by "0x" and followed by * exactly 8 characters. * * @param aObject * The object who's address is to be retrieved. May be * <code>null</code>. * @return Depending on the current architecture. Always starting with "0x" * and than containing the address. * @see System#identityHashCode(Object) */ @Nonnull @Nonempty public static String getObjectAddress (@Nullable final Object aObject) { if (aObject == null) return "0x00000000"; return "0x" + StringHelper.getHexStringLeadingZero (System.identityHashCode (aObject), 8); } }
@Nonnull @Nonempty private static String _getRGBPartAsHexString (final int nRGBPart) { return StringHelper.getHexStringLeadingZero (getRGBValue (nRGBPart), 2); }
@Nonnull @Nonempty private static String _getRGBPartAsHexString (final int nRGBPart) { return StringHelper.getHexStringLeadingZero (getRGBValue (nRGBPart), 2); }