T
- the target type to be converted intopublic static interface RubyDateTimeParsedElementsQuery.MapKeyConverter<T>
Map
from String
to the required type.
For example, the following implementation converts into Ruby's Symbol
object in JRuby.
import org.jruby.Ruby;
import org.jruby.RubySymbol;
public class MapKeyToJRubySymbolConverter implements RubyDateTimeParsedElementsQuery.MapKeyConverter<RubySymbol> {
public MapKeyToJRubySymbolConverter(final Ruby ruby) {
this.ruby = ruby;
}
public RubySymbol convertMapKey(final String mapKey) {
return RubySymbol.newSymbol(this.ruby, mapKey);
}
private final Ruby ruby;
}
Modifier and Type | Method and Description |
---|---|
T |
convertMapKey(String mapKey)
Converts a
String into the required type <T> as keys in the result Map of RubyDateTimeParsedElementsQuery . |
T convertMapKey(String mapKey)
String
into the required type <T>
as keys in the result Map
of RubyDateTimeParsedElementsQuery
.mapKey
- the map key, not null