00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 package com.sleepycat.db;
00011
00012 import com.sleepycat.db.internal.DbConstants;
00013
00014 public class VerifyConfig {
00015 public static final VerifyConfig DEFAULT = new VerifyConfig();
00016
00017
00018 static VerifyConfig checkNull(VerifyConfig config) {
00019 return (config == null) ? DEFAULT : config;
00020 }
00021
00022 private boolean aggressive = false;
00023 private boolean noOrderCheck = false;
00024 private boolean orderCheckOnly = false;
00025 private boolean salvage = false;
00026 private boolean printable = false;
00027
00028 public VerifyConfig() {
00029 }
00030
00031 public void setAggressive(final boolean aggressive) {
00032 this.aggressive = aggressive;
00033 }
00034
00035 public boolean getAggressive() {
00036 return aggressive;
00037 }
00038
00039 public void setNoOrderCheck(final boolean noOrderCheck) {
00040 this.noOrderCheck = noOrderCheck;
00041 }
00042
00043 public boolean getNoOrderCheck() {
00044 return printable;
00045 }
00046
00047 public void setOrderCheckOnly(final boolean orderCheckOnly) {
00048 this.orderCheckOnly = orderCheckOnly;
00049 }
00050
00051 public boolean getOrderCheckOnly() {
00052 return orderCheckOnly;
00053 }
00054
00055 public void setPrintable(final boolean printable) {
00056 this.printable = printable;
00057 }
00058
00059 public boolean getPrintable() {
00060 return printable;
00061 }
00062
00063 public void setSalvage(final boolean salvage) {
00064 this.salvage = salvage;
00065 }
00066
00067 public boolean getSalvage() {
00068 return salvage;
00069 }
00070
00071 int getFlags() {
00072 int flags = 0;
00073 flags |= aggressive ? DbConstants.DB_AGGRESSIVE : 0;
00074 flags |= noOrderCheck ? DbConstants.DB_NOORDERCHK : 0;
00075 flags |= orderCheckOnly ? DbConstants.DB_ORDERCHKONLY : 0;
00076 flags |= salvage ? DbConstants.DB_SALVAGE : 0;
00077 flags |= printable ? DbConstants.DB_PRINTABLE : 0;
00078
00079 return flags;
00080 }
00081 }