Tabnine Logo
NullArgumentException
Code IndexAdd Tabnine to your IDE (free)

How to use
NullArgumentException
in
com.aoindustries.lang

Best Java code snippets using com.aoindustries.lang.NullArgumentException (Showing top 20 results out of 315)

origin: com.aoindustries/ao-lang

/**
 * Checks an argument and throws an exception if null.
 */
public static <T> T checkNotNull(T argument) throws NullArgumentException {
  return checkNotNull(argument, null);
}
origin: com.aoindustries/ao-lang

/**
 * Checks an argument and throws an exception if null.
 */
public static <T> T checkNotNull(T argument, String argumentName) throws NullArgumentException {
  if(argument==null) throw new NullArgumentException(argumentName);
  return argument;
}
origin: com.aoindustries/ao-lang

public LocaleString(Locale locale, String value) {
  this.locale = NullArgumentException.checkNotNull(locale, "locale");
  this.value = NullArgumentException.checkNotNull(value, "value");
}
origin: com.aoindustries/ao-lang

/**
 * Copies all information from one stream to an appendable.
 *
 * @return  the number of bytes copied
 *
 * @see  BufferManager#getChars()
 */
public static long copy(Reader in, Appendable out) throws IOException {
  if(in == null) throw new NullArgumentException("in");
  if(out == null) throw new NullArgumentException("out");
  char[] buff = BufferManager.getChars();
  try {
    long totalChars = 0;
    int numChars;
    while((numChars = in.read(buff, 0, BufferManager.BUFFER_SIZE))!=-1) {
      out.append(new String(buff, 0, numChars));
      totalChars += numChars;
    }
    return totalChars;
  } finally {
    BufferManager.release(buff, false);
  }
}
origin: com.aoindustries/ao-firewalld

ProtocolOrPortRange(Protocol protocol) {
  this.protocol = NullArgumentException.checkNotNull(protocol, "protocol");
  this.portRange = null;
}
origin: com.semanticcms/semanticcms-core-servlet

/**
 * Gets the current page index setup by a combined view or <code>null</code>
 * if not doing a combined view.
 */
public static PageIndex getCurrentPageIndex(ServletRequest request) {
  NullArgumentException.checkNotNull(request, "request");
  return (PageIndex)request.getAttribute(PAGE_INDEX_REQUEST_ATTRIBUTE_NAME);
}
origin: com.aoindustries/ao-firewalld

/**
 * Gets the destination for the given {@link AddressFamily}.
 */
public InetAddressPrefix getDestination(AddressFamily addressFamily) {
  NullArgumentException.checkNotNull(addressFamily);
  switch(addressFamily) {
    case INET  : return destinationIPv4;
    case INET6 : return destinationIPv6;
    default : throw new AssertionError(addressFamily);
  }
}
origin: com.aoindustries/aocode-public

  @Override
  public void addParameter(String name, String value) {
    NullArgumentException.checkNotNull(name, "name");
    NullArgumentException.checkNotNull(value, "value");
    List<String> values = map.get(name);
    if(values==null) map.put(name, values = new ArrayList<String>());
    values.add(value);
  }
}
origin: com.aoindustries/ao-firewalld

/**
 * @param destination  The destination is {@link InetAddressPrefix#normalize() normalized}
 */
Target(InetAddressPrefix destination, ProtocolOrPortRange protocolOrPortRange) {
  this.destination = NullArgumentException.checkNotNull(destination, "destination");
  assert destination == destination.normalize();
  this.protocolOrPortRange = protocolOrPortRange;
}
origin: com.aoindustries/ao-firewalld

/**
 * Parses a protocol value compatible with <code>/etc/protocols</code>.
 */
static Protocol parseProtocol(String protocol) throws IllegalArgumentException {
  NullArgumentException.checkNotNull(protocol);
  // This might need some other type of conversion.  Do as-needed.
  Protocol p = Protocol.getProtocolByKeyword(protocol);
  if(p == null) throw new IllegalArgumentException("Protocol not found: " + protocol);
  return p;
}
origin: com.aoindustries/ao-firewalld

ProtocolOrPortRange(Protocol protocol, IPortRange portRange) {
  this.protocol = NullArgumentException.checkNotNull(protocol, "protocol");
  this.portRange = portRange;
  assert portRange == null || portRange.getProtocol() == protocol;
}
origin: com.aoindustries/ao-firewalld

ProtocolOrPortRange(IPortRange portRange) {
  this.portRange = NullArgumentException.checkNotNull(portRange, "portRange");
  this.protocol = portRange.getProtocol();
}
origin: com.aoindustries/aocode-public

/**
 * Parses a version number from its string representation.
 *
 * @see  #toString()
 */
public static Version valueOf(String version) throws IllegalArgumentException {
  NullArgumentException.checkNotNull(version, "version");
  int dot1Pos = version.indexOf('.');
  if(dot1Pos==-1) throw new IllegalArgumentException(version);
  int dot2Pos = version.indexOf('.', dot1Pos+1);
  if(dot2Pos==-1) throw new IllegalArgumentException(version);
  int dot3Pos = version.indexOf('.', dot2Pos+1);
  if(dot3Pos==-1) throw new IllegalArgumentException(version);
  return getInstance(
    Integer.parseInt(version.substring(0, dot1Pos)),
    Integer.parseInt(version.substring(dot1Pos+1, dot2Pos)),
    Integer.parseInt(version.substring(dot2Pos+1, dot3Pos)),
    Integer.parseInt(version.substring(dot3Pos+1))
  );
}
origin: com.semanticcms/semanticcms-core-servlet

public void setCapturedPage(Page capturedPage) {
  NullArgumentException.checkNotNull(capturedPage, "page");
  if(this.capturedPage != null) {
    throw new IllegalStateException(
      "Cannot capture more than one page: first page="
      + this.capturedPage.getPageRef()
      + ", second page=" + capturedPage.getPageRef()
    );
  }
  this.capturedPage = capturedPage;
}
origin: com.aoindustries/ao-firewalld

/**
 * @param destination  The destination is {@link InetAddressPrefix#normalize() normalized}
 */
public Target(InetAddressPrefix destination, IPortRange portRange) {
  this.destination = NullArgumentException.checkNotNull(destination, "destination").normalize();
  this.protocolOrPortRange = new ProtocolOrPortRange(portRange);
}
origin: com.aoindustries/ao-firewalld

/**
 * @param destination  The destination is {@link InetAddressPrefix#normalize() normalized}
 */
public Target(InetAddressPrefix destination, Protocol protocol) {
  this.destination = NullArgumentException.checkNotNull(destination, "destination").normalize();
  this.protocolOrPortRange = new ProtocolOrPortRange(protocol);
}
origin: com.aoindustries/aocode-public

  && !relativeUrlPath.startsWith("cid:")
) {
  NullArgumentException.checkNotNull(servletPath, "servletPath");
  int slashPos = servletPath.lastIndexOf('/');
  if(slashPos==-1) throw new MalformedURLException("No slash found in servlet path: "+servletPath);
origin: com.aoindustries/aoserv-client

LinuxGroup getPrimaryGroup(LinuxAccount account) throws IOException, SQLException {
  NullArgumentException.checkNotNull(account, "account");
  synchronized(primaryHash) {
origin: com.aoindustries/ao-firewalld

  InetAddressPrefix destinationIPv6
) {
  this.name = NullArgumentException.checkNotNull(name, "name");
  this.version = version==null || version.isEmpty() ? null : version;
  this.shortName = shortName==null || shortName.isEmpty() ? null : shortName;
origin: com.semanticcms/semanticcms-core-servlet

NullArgumentException.checkNotNull(path, "path");
if(path.isEmpty()) throw new IllegalArgumentException("path is empty");
SemanticCMS semanticCMS = SemanticCMS.getInstance(servletContext);
com.aoindustries.langNullArgumentException

Javadoc

Indicates a null argument was passed where not allowed.

Most used methods

  • checkNotNull
    Checks an argument and throws an exception if null.
  • <init>

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JTable (javax.swing)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now