1 /* 2 * Copyright (C) 2022 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 17 package com.android.interactive; 18 19 import java.util.Optional; 20 21 /** 22 * A {@link Step} which is purely informational while some automation happens. 23 */ 24 final class AutomatingStep extends Step<Nothing> { 25 26 private final String mInstruction; 27 AutomatingStep(String instruction)28 public AutomatingStep(String instruction) { 29 mInstruction = instruction; 30 } 31 32 @Override getValue()33 public Optional<Nothing> getValue() { 34 return validate(Nothing.NOTHING); 35 } 36 37 @Override interact()38 public void interact() { 39 show(mInstruction); 40 } 41 42 @Override validate(Nothing b)43 public Optional<Nothing> validate(Nothing b) { 44 return Optional.empty(); 45 } 46 } 47