1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.tradefed.targetprep.multi; 17 18 import com.android.tradefed.config.Option; 19 20 /** Base implementation of {@link IMultiTargetPreparer} that allows to disable the object. */ 21 public abstract class BaseMultiTargetPreparer implements IMultiTargetPreparer { 22 23 @Option(name = "disable", description = "disables the target preparer") 24 private boolean mDisable = false; 25 26 @Option( 27 name = "disable-tear-down", 28 description = "disables the clean up step of a target cleaner" 29 ) 30 private boolean mDisableTearDown = false; 31 32 /** {@inheritDoc} */ 33 @Override isDisabled()34 public final boolean isDisabled() { 35 return mDisable; 36 } 37 38 /** {@inheritDoc} */ 39 @Override isTearDownDisabled()40 public final boolean isTearDownDisabled() { 41 return mDisableTearDown; 42 } 43 44 /** {@inheritDoc} */ 45 @Override setDisable(boolean isDisabled)46 public final void setDisable(boolean isDisabled) { 47 mDisable = isDisabled; 48 } 49 50 /** {@inheritDoc} */ 51 @Override setDisableTearDown(boolean isDisabled)52 public final void setDisableTearDown(boolean isDisabled) { 53 mDisableTearDown = isDisabled; 54 } 55 56 } 57