org.dmfs.rfc3986.UriEncoded Maven / Gradle / Ivy
Show all versions of rfc3986-uri Show documentation
/*
* Copyright 2017 dmfs GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dmfs.rfc3986;
import java.io.UnsupportedEncodingException;
/**
* Interface of a URI encoded {@link CharSequence}.
*
* Note that two {@link UriEncoded} objects ar equal if their encoded values are equal.
*
* @author Marten Gajda
*/
public interface UriEncoded extends CharSequence
{
/**
* Returns a normalized version of this {@link UriEncoded}. In particular that means all unreserved characters are decoded and percent-encoded values are
* converted to uppercase.
*/
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 plain(String charset) throws UnsupportedEncodingException;
/**
* Returns the decoded text assuming UTF-8 encoding.
*
* @return
*/
CharSequence plain();
}