class Token {

    public <T> void setAttribute(CoreTokenField field, T value) {
        if (isFieldReadOnly(field)) {
            throw new IllegalArgumentException(MessageFormat.format(
                    "Token Field {0} is read only and cannot be set.",
                    field.toString()));
        }

        // Validate that the type matches the field they are assigning.
        try {
            CoreTokenFieldTypes.validateType(field, value);
        } catch (CoreTokenException e) {
            throw new IllegalArgumentException(e.getMessage(), e);
        }

        put(field, value);
    }

    private  Token();
    public  Token(String tokenId, TokenType type);
    public  Token(Token copy);

}