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

com.bbn.bue.common.converters.StringToLong Maven / Gradle / Ivy

The newest version!
package com.bbn.bue.common.converters;

import static com.google.common.base.Preconditions.checkNotNull;

public class StringToLong implements StringConverter {

  public StringToLong() {
  }

  public Class getValueClass() {
    return Long.class;
  }

  public Long decode(final String s) {
    try {
      return Long.parseLong(checkNotNull(s));
    } catch (NumberFormatException nfe) {
      throw new ConversionException("Not a long: " + s, nfe);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy