Codota Logo
ObjectTypeAndNamePredicateBuilder
Code IndexAdd Codota to your IDE (free)

How to use
ObjectTypeAndNamePredicateBuilder
in
com.gs.obevo.api.appdata

Best Java code snippets using com.gs.obevo.api.appdata.ObjectTypeAndNamePredicateBuilder (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: com.goldmansachs.obevo/obevo-db

@Override
public ObjectTypeAndNamePredicateBuilder getObjectExclusionPredicateBuilder() {
  return new ObjectTypeAndNamePredicateBuilder(ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE);
}
origin: com.goldmansachs.obevo/obevo-core

/**
 * Returns a new builder instance that combines the filter parameters from the current instances and the parameters
 * from the other input builder. The existing instance remains unchanged.
 */
public ObjectTypeAndNamePredicateBuilder add(ObjectTypeAndNamePredicateBuilder other) {
  if (other == null) {
    return this;
  }
  if (!Objects.equals(this.filterType, other.filterType)) {
    throw new IllegalArgumentException("Filter types must match if we want to combine the builders; this: " + filterType + "; other: " + other.filterType);
  }
  return add(other.objectNamesByType);
}
origin: com.goldmansachs.obevo/obevo-db

  @Override
  public Predicate<? super ChecksumEntry> valueOf(Schema schema) {
    return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1);
  }
});
origin: goldmansachs/obevo

    .add(coreTablesToExclude.toImmutable());
if (excludeObjects != null) {
  objectExclusionPredicateBuilder = objectExclusionPredicateBuilder.add(ObjectTypeAndNamePredicateBuilder.parse(excludeObjects, ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE));
final Predicates<? super RevEngDestination> objectExclusionPredicate = objectExclusionPredicateBuilder.build(
    new Function<RevEngDestination, String>() {
      @Override
origin: com.goldmansachs.obevo/obevo-db

private Predicate<? super ChecksumEntry> getPlatformInclusionPredicate(DbEnvironment env) {
  // 1) exclude those tables that are excluded by default from source code, e.g. explain tables or others that users configure
  ImmutableSet<Predicate<? super ChecksumEntry>> schemaObjectNamePredicates = env.getSchemas().collect(new Function<Schema, Predicate<? super ChecksumEntry>>() {
    @Override
    public Predicate<? super ChecksumEntry> valueOf(Schema schema) {
      return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1);
    }
  });
  // 2) exclude the audit tables
  MutableMultimap<String, String> tablesToExclude = Multimaps.mutable.set.empty();
  tablesToExclude.putAll(ChangeType.TABLE_STR, Sets.immutable.with(
      env.getPlatform().convertDbObjectName().valueOf(getArtifactDeployerDao().getAuditContainerName()),
      env.getPlatform().convertDbObjectName().valueOf(dbChecksumManager.getChecksumContainerName()),
      env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionContainerName()),
      env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionAttributeContainerName())
  ));
  ObjectTypeAndNamePredicateBuilder auditTablePredicateBuilder = new ObjectTypeAndNamePredicateBuilder(tablesToExclude.toImmutable(), ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE);
  Predicates<? super ChecksumEntry> auditTablePredicate = auditTablePredicateBuilder.build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1);
  return auditTablePredicate.and(schemaObjectNamePredicates);
}
origin: goldmansachs/obevo

  @Test
  public void testStringParsingWithExclusionDefault() {
    ObjectTypeAndNamePredicateBuilder parse = ObjectTypeAndNamePredicateBuilder.parse("TABLE~tab1,tab2;VIEW~view1", ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE);
    Predicates<? super Pair<String, String>> predicate = parse.build(Functions.<String>firstOfPair(), (Function<Pair<String, String>, String>) (Function) Functions.<String>secondOfPair());

    assertTrue(predicate.accept(Tuples.pair("OTHER", "otherInclude")));
    assertFalse(predicate.accept(Tuples.pair("TABLE", "tab1")));
    assertFalse(predicate.accept(Tuples.pair("TABLE", "tab2")));
    assertTrue(predicate.accept(Tuples.pair("TABLE", "tabNo")));
    assertFalse(predicate.accept(Tuples.pair("VIEW", "view1")));
    assertTrue(predicate.accept(Tuples.pair("VIEW", "viewInclude")));
  }
}
origin: goldmansachs/obevo

assertTrue(schema.getObjectExclusionPredicateBuilder().getObjectNamesByType().isEmpty());
assertEquals("DEPLOY_TRACKER", env1.getPhysicalSchema("DEPLOY_TRACKER").getPhysicalName());
origin: com.goldmansachs.obevo/obevo-db

    .add(coreTablesToExclude.toImmutable());
if (excludeObjects != null) {
  objectExclusionPredicateBuilder = objectExclusionPredicateBuilder.add(ObjectTypeAndNamePredicateBuilder.parse(excludeObjects, ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE));
final Predicates<? super RevEngDestination> objectExclusionPredicate = objectExclusionPredicateBuilder.build(
    new Function<RevEngDestination, String>() {
      @Override
origin: goldmansachs/obevo

private Predicate<? super ChecksumEntry> getPlatformInclusionPredicate(DbEnvironment env) {
  // 1) exclude those tables that are excluded by default from source code, e.g. explain tables or others that users configure
  ImmutableSet<Predicate<? super ChecksumEntry>> schemaObjectNamePredicates = env.getSchemas().collect(new Function<Schema, Predicate<? super ChecksumEntry>>() {
    @Override
    public Predicate<? super ChecksumEntry> valueOf(Schema schema) {
      return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1);
    }
  });
  // 2) exclude the audit tables
  MutableMultimap<String, String> tablesToExclude = Multimaps.mutable.set.empty();
  tablesToExclude.putAll(ChangeType.TABLE_STR, Sets.immutable.with(
      env.getPlatform().convertDbObjectName().valueOf(getArtifactDeployerDao().getAuditContainerName()),
      env.getPlatform().convertDbObjectName().valueOf(dbChecksumManager.getChecksumContainerName()),
      env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionContainerName()),
      env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionAttributeContainerName())
  ));
  ObjectTypeAndNamePredicateBuilder auditTablePredicateBuilder = new ObjectTypeAndNamePredicateBuilder(tablesToExclude.toImmutable(), ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE);
  Predicates<? super ChecksumEntry> auditTablePredicate = auditTablePredicateBuilder.build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1);
  return auditTablePredicate.and(schemaObjectNamePredicates);
}
origin: goldmansachs/obevo

@Test
public void testStringParsing() {
  ObjectTypeAndNamePredicateBuilder parse = ObjectTypeAndNamePredicateBuilder.parse("TABLE~tab1,tab2;-VIEW~view1", null);
  Predicates<? super Pair<String, String>> predicate = parse.build(Functions.<String>firstOfPair(), (Function<Pair<String, String>, String>) (Function) Functions.<String>secondOfPair());
  assertTrue(predicate.accept(Tuples.pair("OTHER", "otherInclude")));
  assertTrue(predicate.accept(Tuples.pair("TABLE", "tab1")));
  assertTrue(predicate.accept(Tuples.pair("TABLE", "tab2")));
  assertFalse(predicate.accept(Tuples.pair("TABLE", "tabNo")));
  assertFalse(predicate.accept(Tuples.pair("VIEW", "view1")));
  assertTrue(predicate.accept(Tuples.pair("VIEW", "viewInclude")));
}
origin: goldmansachs/obevo

expectedExclusions.putAll(ChangeType.VIEW_STR, Lists.immutable.with("view1Pat", "view2%Pat"));
expectedExclusions.putAll(ChangeType.SP_STR, Lists.immutable.with("sp1", "sp2", "sp3", "sp4"));
assertEquals(expectedExclusions, schema1.getObjectExclusionPredicateBuilder().getObjectNamesByType());
origin: com.goldmansachs.obevo/obevo-mongodb

@Override
public ObjectTypeAndNamePredicateBuilder getObjectExclusionPredicateBuilder() {
  return new ObjectTypeAndNamePredicateBuilder(ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE);
}
origin: goldmansachs/obevo

/**
 * Returns a new builder instance that combines the filter parameters from the current instances and the parameters
 * from the other input builder. The existing instance remains unchanged.
 */
public ObjectTypeAndNamePredicateBuilder add(ObjectTypeAndNamePredicateBuilder other) {
  if (other == null) {
    return this;
  }
  if (!Objects.equals(this.filterType, other.filterType)) {
    throw new IllegalArgumentException("Filter types must match if we want to combine the builders; this: " + filterType + "; other: " + other.filterType);
  }
  return add(other.objectNamesByType);
}
origin: goldmansachs/obevo

  @Override
  public Predicate<? super ChecksumEntry> valueOf(Schema schema) {
    return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1);
  }
});
origin: goldmansachs/obevo

@Override
public ObjectTypeAndNamePredicateBuilder getObjectExclusionPredicateBuilder() {
  return new ObjectTypeAndNamePredicateBuilder(ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE);
}
origin: goldmansachs/obevo

@Override
public ObjectTypeAndNamePredicateBuilder getObjectExclusionPredicateBuilder() {
  return super.getObjectExclusionPredicateBuilder().add(Multimaps.immutable.set.with(
      ChangeType.TABLE_STR, "rs_%",
      ChangeType.SP_STR, "rs_%"
  ));
}
origin: com.goldmansachs.obevo/obevo-db

  @Override
  public RichIterable<DbCleanCommand> valueOf(PhysicalSchema physicalSchema) {
    ImmutableList<DbCleanCommand> schemaDrops = getDropStatements(physicalSchema);
    MutableCollection<Schema> schemas = physicalSchemaToSchemaMap.get(physicalSchema);
    for (Schema schema : schemas) {
      schemaDrops = schemaDrops.select(schema.getObjectExclusionPredicateBuilder().build(new Function<DbCleanCommand, String>() {
        @Override
        public String valueOf(DbCleanCommand it) {
          return it.getObjectType().getName();
        }
      }, DbCleanCommand.TO_OBJECT_NAME));
    }
    return schemaDrops;
  }
}).toList());
origin: goldmansachs/obevo

@Override
public ObjectTypeAndNamePredicateBuilder getObjectExclusionPredicateBuilder() {
  return new ObjectTypeAndNamePredicateBuilder(ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE);
}
origin: com.goldmansachs.obevo/obevo-db-mssql

@Override
public ObjectTypeAndNamePredicateBuilder getObjectExclusionPredicateBuilder() {
  return super.getObjectExclusionPredicateBuilder().add(Multimaps.immutable.set.with(
      ChangeType.TABLE_STR, "rs_%",
      ChangeType.SP_STR, "rs_%"
  ));
}
origin: goldmansachs/obevo

  @Override
  public RichIterable<DbCleanCommand> valueOf(PhysicalSchema physicalSchema) {
    ImmutableList<DbCleanCommand> schemaDrops = getDropStatements(physicalSchema);
    MutableCollection<Schema> schemas = physicalSchemaToSchemaMap.get(physicalSchema);
    for (Schema schema : schemas) {
      schemaDrops = schemaDrops.select(schema.getObjectExclusionPredicateBuilder().build(new Function<DbCleanCommand, String>() {
        @Override
        public String valueOf(DbCleanCommand it) {
          return it.getObjectType().getName();
        }
      }, DbCleanCommand.TO_OBJECT_NAME));
    }
    return schemaDrops;
  }
}).toList());
com.gs.obevo.api.appdataObjectTypeAndNamePredicateBuilder

Javadoc

Predicate builder that works off the object type and object name. Can work on any kind of object; just needs functions passed in from the target class to filter on that maps to the object type and name values.

Most used methods

  • <init>
  • add
  • build
    Builds the predicate on object type and name based on the input functions passed in.
  • parse
  • getObjectNamesByType
    Only exposed for testing and debugging.

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JComboBox (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now