// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/UriEncoded.java
// public interface UriEncoded extends CharSequence
// {
//     /**
//      * Returns a normalized version of this {@link UriEncoded}. In particular that means any percent-encoded unreserved characters are decoded and
//      * percent-encoding sequences are converted to uppercase.
//      *
//      * @return The normalized version of this {@link UriEncoded}.
//      */
//     UriEncoded normalized();
// 
//     /**
//      * Returns the decoded text, using the given charset to decode the non-ASCII characters.
//      *
//      * @param charset
//      *         The name of the charset.
//      *
//      * @return
//      */
//     CharSequence decoded(String charset) throws UnsupportedEncodingException;
// 
//     /**
//      * Returns the decoded text assuming UTF-8 encoding.
//      *
//      * @return
//      */
//     CharSequence decoded();
// 
//     @Override
//     UriEncoded subSequence(int startIndex, int endIndex);
// 
//     @Override
//     String toString();
// }
// 
// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/utils/Parsed.java
// public interface Parsed
// {
//     /**
//      * The length of the component in the source.
//      *
//      * @return
//      */
//     int parsedLength();
// }
// 
// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/validation/CharSets.java
// public final static CharSet REG_NAME_CHAR = new BitMapCharSet(0, 0x2BFF7FF2, 0x87FFFFFE, 0x47FFFFFE);


import org.dmfs.optional.Optional;
import org.dmfs.optional.Present;
import org.dmfs.rfc3986.UriEncoded;
import org.dmfs.rfc3986.utils.Parsed;
import java.util.NoSuchElementException;
import static org.dmfs.optional.Absent.absent;
import static org.dmfs.rfc3986.validation.CharSets.REG_NAME_CHAR;
    }


    @Override
    public UriEncoded value() throws NoSuchElementException
    {
        return userInfo().value();
    }


    private Optional<UriEncoded> userInfo()
    {
        if (mUserInfo == null)
        {
            mUserInfo = parsedUserInfo();
        }
        return mUserInfo;
    }


    private Optional<UriEncoded> parsedUserInfo()
    {
        final UriEncoded encodedAuthority = mEncodedAuthority;
        final int count = encodedAuthority.length();
        int i = 0;
        while (i < count && (REG_NAME_CHAR.contains(encodedAuthority.charAt(i)) || encodedAuthority.charAt(i) == ':'))
        {
            ++i;
        }

// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/UriEncoded.java
// public interface UriEncoded extends CharSequence
// {
//     /**
//      * Returns a normalized version of this {@link UriEncoded}. In particular that means any percent-encoded unreserved characters are decoded and
//      * percent-encoding sequences are converted to uppercase.
//      *
//      * @return The normalized version of this {@link UriEncoded}.
//      */
//     UriEncoded normalized();
// 
//     /**
//      * Returns the decoded text, using the given charset to decode the non-ASCII characters.
//      *
//      * @param charset
//      *         The name of the charset.
//      *
//      * @return
//      */
//     CharSequence decoded(String charset) throws UnsupportedEncodingException;
// 
//     /**
//      * Returns the decoded text assuming UTF-8 encoding.
//      *
//      * @return
//      */
//     CharSequence decoded();
// 
//     @Override
//     UriEncoded subSequence(int startIndex, int endIndex);
// 
//     @Override
//     String toString();
// }
// 
// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/utils/Parsed.java
// public interface Parsed
// {
//     /**
//      * The length of the component in the source.
//      *
//      * @return
//      */
//     int parsedLength();
// }
// 
// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/validation/CharSets.java
// public final static CharSet REG_NAME_CHAR = new BitMapCharSet(0, 0x2BFF7FF2, 0x87FFFFFE, 0x47FFFFFE);


// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/authorities/OptionalLazyUserInfo.java
import org.dmfs.optional.Optional;
import org.dmfs.optional.Present;
import org.dmfs.rfc3986.UriEncoded;
import org.dmfs.rfc3986.utils.Parsed;
import java.util.NoSuchElementException;
import static org.dmfs.optional.Absent.absent;
import static org.dmfs.rfc3986.validation.CharSets.REG_NAME_CHAR;

    }


    @Override
    public UriEncoded value() throws NoSuchElementException
    {
        return userInfo().value();
    }


    private Optional<UriEncoded> userInfo()
    {
        if (mUserInfo == null)
        {
            mUserInfo = parsedUserInfo();
        }
        return mUserInfo;
    }


    private Optional<UriEncoded> parsedUserInfo()
    {
        final UriEncoded encodedAuthority = mEncodedAuthority;
        final int count = encodedAuthority.length();
        int i = 0;
        while (i < count && (REG_NAME_CHAR.contains(encodedAuthority.charAt(i)) || encodedAuthority.charAt(i) == ':'))
        {
            ++i;
        }

        if (i == count || encodedAuthority.charAt(i) != '@')