All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.cli.converters.NullableIntegerConverter Maven / Gradle / Ivy

package org.infinispan.cli.converters;

import org.aesh.command.converter.Converter;
import org.aesh.command.converter.ConverterInvocation;

/**
 * @author Tristan Tarrant <[email protected]>
 * @since 11.0
 **/
public class NullableIntegerConverter implements Converter {
   @Override
   public Integer convert(ConverterInvocation invocation) {
      String input = invocation.getInput();
      return input == null || input.isEmpty() ? null : Integer.parseInt(input);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy