Java Assert Not Null assertPatternNotNull(String methodName, String pattern)

Here you can find the source of assertPatternNotNull(String methodName, String pattern)

Description

assert Pattern Not Null

License

Apache License

Declaration

protected static void assertPatternNotNull(String methodName,
            String pattern) 

Method Source Code

//package com.java2s;
/*//from   w w  w  . j  av a 2 s  . c  om
 * Copyright 2014-2015 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

public class Main {
    protected static void assertPatternNotNull(String methodName,
            String pattern) {
        if (pattern == null) {
            String msg = "The argument 'pattern' should not be null: method="
                    + methodName;
            throw new IllegalArgumentException(msg);
        }
    }
}

Related

  1. assertObjectNotNull(String variableName, Object value)
  2. assertObjectNotNull(String variableName, Object value)
  3. assertParameterNotNull(Object parameterValue, String errorMessage)
  4. assertParamNotNull(Object check, String paramName)
  5. assertParamNotNull(String param, String paramName)
  6. assertResourceNotNull(String resourcePath, Object resourceHandle)
  7. assertStringNotNullAndNotTrimmedEmpty( String variableName, String value)
  8. assertStringNotNullNorEmpty(String str, String name)
  9. assertStringNotNullOrEmpty(String str, String name)