View Javadoc
1   /*
2    * Copyright 2006 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.gl.service.impl;
17  
18  import org.kuali.ole.gl.ObjectHelper;
19  
20  /**
21   * Provides helper methods related to evaluating Strings 
22   */
23  public class StringHelper extends ObjectHelper {
24  
25      /**
26       * This method returns true if String object is empty and NOT null 
27       * 
28       * @param s evaluated String
29       * @return true if String object is empty and NOT null
30       */
31      static public boolean isEmpty(String s) {
32          return (s != null) && "".equals(s);
33      }
34  
35      /**
36       * This method returns true if String object is null or empty
37       * @param s evaluated String
38       * @return true if String object is null or empty
39       */
40      static public boolean isNullOrEmpty(String s) {
41          return (s == null) || isEmpty(s);
42      }
43  }