package io.jenetics.incubator.parser;

import static java.lang.String.format;
import static java.util.Objects.requireNonNull;

public final class Token {
	private final int _type;
	private final String _value;

	public Token(final int type, final String value) {
		_type = type;
		_value = requireNonNull(value);
	}

	public int type() {
		return _type;
	}

	public String value() {
		return _value;
	}

	@Override
	public String toString() {
		return format("Token[%d, '%s']", _type, _value);
	}

}

@@ -36,47 +36,8 @@
 r;%0A%0A
-import static java.lang.String.format;%0A
 impo
@@ -98,70 +98,38 @@
 nal 
-class Token %7B%0A%09private final 
+record Token(
 int 
-_
 type
-;%0A%09private final
+,
  String 
 _val
@@ -124,24 +124,24 @@
  String 
-_
 value
-;%0A
+) %7B
 %0A%09public
@@ -150,280 +150,37 @@
 oken
-(final int type, final String value) %7B%0A%09%09_type = type;%0A%09%09_value = requireNonNull(value);%0A%09%7D%0A%0A%09public int type() %7B%0A%09%09return _type;%0A%09%7D%0A%0A%09public String value() %7B%0A%09%09return _value;%0A%09%7D%0A%0A%09@Override%0A%09public String toString() %7B%0A%09%09return format(%22Token%5B%25d, '%25s'%5D%22, _type, _value);%0A%09%7D%0A
+ %7B%0A%09%09requireNonNull(value);%0A%09%7D
 %0A%7D%0A

Convert 'Token' to record.