Java Hash String hasHexOrDecLongUrnSuffix(String value)

Here you can find the source of hasHexOrDecLongUrnSuffix(String value)

Description

has Hex Or Dec Long Urn Suffix

License

Open Source License

Declaration

public static boolean hasHexOrDecLongUrnSuffix(String value) 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean hasHexOrDecLongUrnSuffix(String value) {
        String[] arr = value.split(":");
        String suffix = arr[arr.length - 1];
        return assertHexOrDecLongValue(suffix);
    }/*  www .  ja v  a2  s.  co  m*/

    public static boolean assertHexOrDecLongValue(String value) {
        try {
            parseHexOrDecLong(value);
        } catch (NumberFormatException nfe) {
            return false;
        }
        return true;
    }

    public static Long parseHexOrDecLong(String value) {
        return value.startsWith("0x") ? Long.parseLong(value.substring(2), 16) : Long.parseLong(value, 10);
    }
}

Related

  1. hashCodeIgnoreCase(String a)
  2. hashCodeOfStringArray(String[] stringArray)
  3. hashCodeToString(byte[] hash)
  4. hashCodeToString(long code)
  5. hasHeirarchy(String xpath)
  6. hasHexPrefix(final String hexSymbols)
  7. hasHighChars(String s)
  8. hasHint(String hint, String parameter)
  9. hashIt(String s)