mirror of
				https://github.com/OpenAPITools/openapi-generator.git
				synced 2025-11-04 10:43:44 +00:00 
			
		
		
		
	Add comments to string utility methods
This commit is contained in:
		
							parent
							
								
									19a8ac4841
								
							
						
					
					
						commit
						ed14c515bf
					
				@ -1,6 +1,13 @@
 | 
				
			|||||||
package {{invokerPackage}};
 | 
					package {{invokerPackage}};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class StringUtil {
 | 
					public class StringUtil {
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * Check if the given array contains the given value (with case-insensitive comparison).
 | 
				
			||||||
 | 
					   *
 | 
				
			||||||
 | 
					   * @param array The array
 | 
				
			||||||
 | 
					   * @param value The value to search
 | 
				
			||||||
 | 
					   * @return true if the array contains the value
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  public static boolean containsIgnoreCase(String[] array, String value) {
 | 
					  public static boolean containsIgnoreCase(String[] array, String value) {
 | 
				
			||||||
    for (String str : array) {
 | 
					    for (String str : array) {
 | 
				
			||||||
      if (value == null && str == null) return true;
 | 
					      if (value == null && str == null) return true;
 | 
				
			||||||
@ -9,6 +16,17 @@ public class StringUtil {
 | 
				
			|||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * Join an array of strings with the given separator.
 | 
				
			||||||
 | 
					   * <p>
 | 
				
			||||||
 | 
					   * Note: This might be replaced by utility method from commons-lang or guava someday
 | 
				
			||||||
 | 
					   * if one of those libraries is added as dependency.
 | 
				
			||||||
 | 
					   * </p>
 | 
				
			||||||
 | 
					   *
 | 
				
			||||||
 | 
					   * @param array     The array of strings
 | 
				
			||||||
 | 
					   * @param separator The separator
 | 
				
			||||||
 | 
					   * @return the resulting string
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  public static String join(String[] array, String separator) {
 | 
					  public static String join(String[] array, String separator) {
 | 
				
			||||||
    int len = array.length;
 | 
					    int len = array.length;
 | 
				
			||||||
    if (len == 0) return "";
 | 
					    if (len == 0) return "";
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,13 @@
 | 
				
			|||||||
package io.swagger.client;
 | 
					package io.swagger.client;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class StringUtil {
 | 
					public class StringUtil {
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * Check if the given array contains the given value (with case-insensitive comparison).
 | 
				
			||||||
 | 
					   *
 | 
				
			||||||
 | 
					   * @param array The array
 | 
				
			||||||
 | 
					   * @param value The value to search
 | 
				
			||||||
 | 
					   * @return true if the array contains the value
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  public static boolean containsIgnoreCase(String[] array, String value) {
 | 
					  public static boolean containsIgnoreCase(String[] array, String value) {
 | 
				
			||||||
    for (String str : array) {
 | 
					    for (String str : array) {
 | 
				
			||||||
      if (value == null && str == null) return true;
 | 
					      if (value == null && str == null) return true;
 | 
				
			||||||
@ -9,6 +16,17 @@ public class StringUtil {
 | 
				
			|||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * Join an array of strings with the given separator.
 | 
				
			||||||
 | 
					   * <p>
 | 
				
			||||||
 | 
					   * Note: This might be replaced by utility method from commons-lang or guava someday
 | 
				
			||||||
 | 
					   * if one of those libraries is added as dependency.
 | 
				
			||||||
 | 
					   * </p>
 | 
				
			||||||
 | 
					   *
 | 
				
			||||||
 | 
					   * @param array     The array of strings
 | 
				
			||||||
 | 
					   * @param separator The separator
 | 
				
			||||||
 | 
					   * @return the resulting string
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  public static String join(String[] array, String separator) {
 | 
					  public static String join(String[] array, String separator) {
 | 
				
			||||||
    int len = array.length;
 | 
					    int len = array.length;
 | 
				
			||||||
    if (len == 0) return "";
 | 
					    if (len == 0) return "";
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user