// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/parameters/Parameter.java
// public interface Parameter
// {
//     /**
//      * Returns the name of the parameter.
//      *
//      * @return The parameter name,
//      */
//     CharSequence name();
// 
//     /**
//      * Returns the text value of the parameter.
//      *
//      * @return A {@link CharSequence} containing the parameter value in its text form.
//      */
//     CharSequence textValue();
// }
// 
// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/parameters/ParameterType.java
// public interface ParameterType<T>
// {
//     /**
//      * Returns the name of the parameter.
//      *
//      * @return
//      */
//     CharSequence name();
// 
//     /**
//      * Returns the parsed value of the given {@link Parameter}.
//      *
//      * @param parameter
//      *         The {@link Parameter} to parse.
//      *
//      * @return
//      */
//     T value(Parameter parameter);
// 
//     /**
//      * Returns a parameter of this type with the given value.
//      *
//      * @param value
//      *
//      * @return
//      */
//     Parameter parameter(T value);
// }
// 
// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/parameters/ValueType.java
// public interface ValueType<T>
// {
//     /**
//      * Returns the parsed value of the given text value.
//      *
//      * @param valueText
//      *         The text representation of the value.
//      *
//      * @return The parsed value.
//      */
//     T parsedValue(CharSequence valueText);
// 
//     /**
//      * Serializes the given value to its plain text representation.
//      *
//      * @param value
//      *         The value to serialize.
//      *
//      * @return The serialized value.
//      */
//     CharSequence serializedValue(T value);
// }


import org.dmfs.rfc3986.parameters.Parameter;
import org.dmfs.rfc3986.parameters.ParameterType;
import org.dmfs.rfc3986.parameters.ValueType;
/*
 * 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.parameters.parametertypes;



/**
 * A basic {@link ParameterType} implementation.
 *
 * @author Marten Gajda
 */
public final class BasicParameterType<T> implements ParameterType<T>
{
    private final CharSequence mName;
    private final ValueType<T> mValueType;


    /**
     * Creates a {@link ParameterType} with the given name and {@link ValueType}.
     *
     * @param name
     * @param valueType
     */
// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/parameters/Parameter.java
// public interface Parameter
// {
//     /**
//      * Returns the name of the parameter.
//      *
//      * @return The parameter name,
//      */
//     CharSequence name();
// 
//     /**
//      * Returns the text value of the parameter.
//      *
//      * @return A {@link CharSequence} containing the parameter value in its text form.
//      */
//     CharSequence textValue();
// }
// 
// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/parameters/ParameterType.java
// public interface ParameterType<T>
// {
//     /**
//      * Returns the name of the parameter.
//      *
//      * @return
//      */
//     CharSequence name();
// 
//     /**
//      * Returns the parsed value of the given {@link Parameter}.
//      *
//      * @param parameter
//      *         The {@link Parameter} to parse.
//      *
//      * @return
//      */
//     T value(Parameter parameter);
// 
//     /**
//      * Returns a parameter of this type with the given value.
//      *
//      * @param value
//      *
//      * @return
//      */
//     Parameter parameter(T value);
// }
// 
// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/parameters/ValueType.java
// public interface ValueType<T>
// {
//     /**
//      * Returns the parsed value of the given text value.
//      *
//      * @param valueText
//      *         The text representation of the value.
//      *
//      * @return The parsed value.
//      */
//     T parsedValue(CharSequence valueText);
// 
//     /**
//      * Serializes the given value to its plain text representation.
//      *
//      * @param value
//      *         The value to serialize.
//      *
//      * @return The serialized value.
//      */
//     CharSequence serializedValue(T value);
// }


// Path: rfc3986-uri/src/main/java/org/dmfs/rfc3986/parameters/parametertypes/BasicParameterType.java
import org.dmfs.rfc3986.parameters.Parameter;
import org.dmfs.rfc3986.parameters.ParameterType;
import org.dmfs.rfc3986.parameters.ValueType;

/*
 * 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.parameters.parametertypes;



/**
 * A basic {@link ParameterType} implementation.
 *
 * @author Marten Gajda
 */
public final class BasicParameterType<T> implements ParameterType<T>
{
    private final CharSequence mName;
    private final ValueType<T> mValueType;


    /**
     * Creates a {@link ParameterType} with the given name and {@link ValueType}.
     *
     * @param name
     * @param valueType
     */
    public BasicParameterType(CharSequence name, ValueType<T> valueType)