Package com.hp.hpl.jena.shared.uuid.JenaUUID

Examples of com.hp.hpl.jena.shared.uuid.JenaUUID.UUIDFormatException


    @Override
    public JenaUUID parse(String s) throws UUIDFormatException {
        s = s.toLowerCase(Locale.ENGLISH) ;

        if ( s.length() != 36 )
            throw new UUIDFormatException("UUID string is not 36 chars long: it's " + s.length() + " [" + s + "]") ;

        if ( s.charAt(8) != '-' && s.charAt(13) != '-' && s.charAt(18) != '-' && s.charAt(23) != '-' )
            throw new UUIDFormatException("String does not have dashes in the right places: " + s) ;

        UUID_V1 u = parse$(s) ;
        if ( u.getVersion() != versionHere )
            throw new UUIDFormatException("Wrong version (Expected: " + versionHere + "Got: " + u.getVersion() + "): " + s) ;
        if ( u.getVariant() != variantHere )
            throw new UUIDFormatException("Wrong version (Expected: " + variantHere + "Got: " + u.getVariant() + "): " + s) ;
        return u ;
    }
View Full Code Here


    public UUID_V4 parseV4(String s)
    {
        s = s.toLowerCase(Locale.ENGLISH) ;

        if ( s.length() != 36 )
            throw new UUIDFormatException("UUID string is not 36 chars long: it's "+s.length()+" ["+s+"]") ;

        if ( s.charAt(8!= '-' && s.charAt(13) != '-' && s.charAt(18) != '-' && s.charAt(23) != '-' )
            throw new UUIDFormatException("String does not have dashes in the right places: "+s) ;

        UUID_V4 u = parse$(s) ;
        if ( u.getVersion() != versionHere )
            throw new UUIDFormatException("Wrong version (Expected: "+versionHere+"Got: "+u.getVersion()+"): "+s) ;
        if ( u.getVariant() != variantHere )
            throw new UUIDFormatException("Wrong version (Expected: "+variantHere+"Got: "+u.getVariant()+"): "+s) ;
        return u ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.shared.uuid.JenaUUID.UUIDFormatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.