1 /* 2 * Copyright (C) 2019 The Dagger Authors. 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 dagger.example.atm; 18 19 import java.math.BigDecimal; 20 21 /** An ATM database. */ 22 interface Database { getAccount(String username)23 Account getAccount(String username); 24 25 /** An individual user's account. */ 26 interface Account { username()27 String username(); 28 deposit(BigDecimal amount)29 void deposit(BigDecimal amount); 30 withdraw(BigDecimal amount)31 void withdraw(BigDecimal amount); 32 balance()33 BigDecimal balance(); 34 } 35 } 36