Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.javatools.db.extension
Class DatabaseMatcher

java.lang.Object
  extended by oracle.javatools.db.extension.DatabaseMatcher


public class DatabaseMatcher
extends java.lang.Object

Immutable class used to match a database release by type and version(s).

Example 1: Match any Oracle database

 DatabaseMatcher dm =
   new DatabaseMatcher( OracleDatabase.ORACLE_DATABASE_TYPE );
 

Example 2: Match Oracle databases 10gR1 and above

 DatabaseMatcher dm =
   new DatabaseMatcher( OracleDatabase.ORACLE_DATABASE_TYPE,
                        OracleDatabase.ORACLE10g_TYPE,
                        DatabaseMatcher.Comparison.MINIMUM );
 

Example 3: Match only Oracle 11gR2

 DatabaseMatcher dm =
   new DatabaseMatcher( OracleDatabase.ORACLE_DATABASE_TYPE,
                        OracleDatabase.ORACLE11gR2_TYPE,
                        DatabaseMatcher.Comparison.EXACT );
 
Since:
11.1.1.4.0

Nested Class Summary
static class DatabaseMatcher.Comparison
          Used to indicate how the version should be matched.

 

Constructor Summary
DatabaseMatcher(java.lang.String dbType)
          Matches all database of the given database type.
DatabaseMatcher(java.lang.String dbType, int version, DatabaseMatcher.Comparison comparison)
          Matches database of the given database type, by comparing the version number using the given comparison type.

 

Method Summary
 boolean equals(java.lang.Object obj)
          Tests that the other object is a DatabaseMatcher with exactly the same criteria as this matcher.
 java.lang.String getDatabaseType()
          Gets the type of database this will match.
 int hashCode()
           
 boolean matches(java.lang.String dbType, int version)
           
protected  boolean matchesType(java.lang.String dbType)
           
protected  boolean matchesVersion(int version)
           

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DatabaseMatcher

public DatabaseMatcher(java.lang.String dbType)
Matches all database of the given database type.

DatabaseMatcher

public DatabaseMatcher(java.lang.String dbType,
                       int version,
                       DatabaseMatcher.Comparison comparison)
Matches database of the given database type, by comparing the version number using the given comparison type.

Method Detail

getDatabaseType

public java.lang.String getDatabaseType()
Gets the type of database this will match.

matchesType

protected boolean matchesType(java.lang.String dbType)

matchesVersion

protected boolean matchesVersion(int version)

matches

public boolean matches(java.lang.String dbType,
                       int version)

equals

public boolean equals(java.lang.Object obj)
Tests that the other object is a DatabaseMatcher with exactly the same criteria as this matcher.
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


Copyright © 1997, 2012, Oracle. All rights reserved.