@Override public String quoteIdentifier(String identifier, boolean quoteKeywordOnly) { if(Strings.equalsIgnoreCase(identifier,"dual")){ return identifier; } return super.quoteIdentifier(identifier,quoteKeywordOnly); }
protected DbSequence findSequence(DbSequence[] sequences,String name){ for(int i=0;i<sequences.length;i++){ DbSequence sequence = sequences[i]; if(Strings.equalsIgnoreCase(name, sequence.getName())){ return sequence; } } return null; } }
public boolean equalsIgnoreCase(DbForeignKeyColumn that){ if(null == that){ return false; } if(!Strings.equalsIgnoreCase(this.localColumnName, that.getLocalColumnName())){ return false; } if(!Strings.equalsIgnoreCase(this.foreignColumnName, that.getForeignColumnName())){ return false; } return true; }
/** * Returns <code>true</code> if current token is {@link Token#IDENTIFIER} * * and the identifier literal equals to the given string. */ public final boolean isIdentifier(String string){ return _token == Token.IDENTIFIER && Strings.equalsIgnoreCase(this.literal(), string); }
protected DbTable findTable(DbTable[] tables,String name){ for(int i=0;i<tables.length;i++){ DbTable table = tables[i]; if(Strings.equalsIgnoreCase(name, table.getName())){ return table; } } return null; }
public boolean test(T object) { return Strings.equalsIgnoreCase(object.getName(),name); } };
public boolean equalsIgnoreCase(DbSchemaObjectName that){ if(null == that){ return false; } return Strings.equalsIgnoreCase(this.getQualifiedName(), that.getQualifiedName()); }
protected boolean isTableOfWithAcronym(String acronym,String tableName,String entityName){ if(tableName.startsWith(acronym + "_")) { String tableToEntityName = tableToEntityName(tableName.substring(acronym.length() + 1)); //equals if(Strings.equalsIgnoreCase(entityName, tableToEntityName)){ return true; } //singular <-> plural if(isPluralOf(entityName, tableToEntityName) || isPluralOf(tableToEntityName, entityName)){ return true; } } return false; }
public FieldMappingBuilder findFieldMappingByName(String name) { for (FieldMappingBuilder fmb : getFieldMappings()) { if (Strings.equalsIgnoreCase(name, fmb.getFieldName())) { return fmb; } } return null; }
protected boolean matchProfile(String profile, XmlReader element) { String profileName = element.getAttribute(IF_PROFILE_ATTRIBUTE); if(!Strings.isEmpty(profileName)){ return Strings.equalsIgnoreCase(profile, profileName); }else{ return true; } } }
public FieldMappingBuilder findFieldMappingByMetaName(String name) { for (FieldMappingBuilder fmb : getFieldMappings()) { if (Strings.equalsIgnoreCase(name, fmb.getMetaFieldName())) { return fmb; } if (null != fmb.getReservedMetaFieldName() && Strings.equalsIgnoreCase(name, fmb.getReservedMetaFieldName().getFieldName())) { return fmb; } } return null; }
@Override public boolean isTableOfEntity(String tableName, String entityName) { String tableToEntityName = tableToEntityName(tableName); //equals if(Strings.equalsIgnoreCase(entityName, tableToEntityName)){ return true; } //singular <-> plural if(isPluralOf(entityName, tableToEntityName) || isPluralOf(tableToEntityName, entityName)){ return true; } return false; }
public FieldMappingBuilder findFieldMappingByColumn(String column) { for (FieldMappingBuilder fmb : getFieldMappings()) { if (Strings.equalsIgnoreCase(column, fmb.getColumn().getName())) { return fmb; } } return null; }
@Override public boolean isColumnOfField(String columnName, String fieldName) { String columnToFieldName = columnToFieldName(columnName); //equals if(Strings.equalsIgnoreCase(fieldName, columnToFieldName)){ return true; } //singular <-> plural if(isPluralOf(fieldName, columnToFieldName) || isPluralOf(columnToFieldName, fieldName)){ return true; } return false; }
protected void checkDuplicate(ApiConfig c) { String key = c.getName().toLowerCase(); if(apis.containsKey(key)) { throw new ObjectExistsException("The api '" + c.getName() + "' already exists"); } apis.values().forEach(api -> { if(Strings.equalsIgnoreCase(api.getBasePath(),c.getBasePath())){ throw new ApiConfigException("Found duplicated api config with base path: " + c.getBasePath() + " in " + api.getConfig().getSource() + " and " + c.getSource()); } }); }
protected static boolean matchProfile(BeanContainer container, XmlReader element) { String profile = element.getAttribute(IF_PROFILE); if (!Strings.isEmpty(profile)) { return Strings.equalsIgnoreCase(container.getAppConfig().getProfile(), profile); } else { return true; } }
public MetaOperation getOperation(String method, String path) { for (MetaOperation o : operations) { if (Strings.equalsIgnoreCase(o.getMethod().name(), method)) { if (Strings.equals(o.getPath(), path)) { return o; } } } return null; }
protected final boolean matches(SecuredPath p, Request request){ return p.matches(request) && (p.getRoute() == null || Strings.equals(p.getRoute().getMethod(),"*") || Strings.equalsIgnoreCase(p.getRoute().getMethod(),request.getMethod())); }
private boolean matches(SecuredPath p,Request request){ return p.matches(request) && (p.getRoute() == null || Strings.equals(p.getRoute().getMethod(),"*") || Strings.equalsIgnoreCase(p.getRoute().getMethod(),request.getMethod())); }
@Override public SchemaChanges compareTable(DbTable source, DbTable target) throws UnsupportedChangeException { Args.notNull(source,"source table"); Args.notNull(target,"target table"); Assert.isTrue(Strings.equalsIgnoreCase(source.getName(),target.getName()), "Can't compare two table which name are not equals : {0} -> {1}",source.getName(),target.getName()); GenericSchemaChanges changes = db.createSchemaChanges(); compareTable(changes, source, target); return changes; }