Java create enum from String : <p>I have enum class </p>

<pre><code>public enum PaymentType {

    /**
     * This notify type we receive when user make first subscription payment.
     */
    SUBSCRIPTION_NEW("subscr_signup"),

    /**
     * This notify type we receive when user make subscription payment for next
     * month.
     */
    SUBSCRIPTION_PAYMENT("subscr_payment"),

    /**
     * This notify type we receive when user cancel subscription from his paypal
     * personal account.
     */
    SUBSCRIPTION_CANCEL("subscr_cancel"),

    /**
     * In this case the user cannot change the amount or length of the
     * subscription, they can however change the funding source or address
     * associated with their account. Those actions will generate the
     * subscr_modify IPN that we are receiving.
     */
    SUBSCRIPTION_MODIFY("subscr_modify"),

    /**
     * Means that the subscription has expired, either because the subscriber
     * cancelled it or it has a fixed term (implying a fixed number of payments)
     * and it has now expired with no further payments being due. It is sent at
     * the end of the term, instead of any payment that would otherwise have
     * been due on that date.
     */
    SUBSCRIPTION_EXPIRED("subscr_eot"),

    /** User have no money on card, CVV error, another negative errors. */
    SUBSCRIPTION_FAILED("subscr_failed");

    private String type;

    PaymentType(String type) {
        this.type = type;
    }

    String getType() {
        return type;
    }
}
</code></pre>

<p>When I try to create enum :</p>

<pre><code>PaymentType type = PaymentType.valueOf("subscr_signup");
</code></pre>

<p>Java throws to me error :</p>

<pre><code>IllegalArgumentException occured : No enum constant models.PaymentType.subscr_signup
</code></pre>

<p>How I can fix this?</p>
