private static void queryAction(Query query, Storage storage) {
        switch (query.type) {
            case ADD : {
                if (storage.addRecord(query.rec)) {
                    System.out.println("This person is already exists. Record was updated");
                } else {
                    System.out.println("The record with this person was created");
                }
                break;
            }
            case GET : {
                Record rec = storage.getRecord(query.rec.name);
                if (rec != null) {
                    System.out.println(rec.number);
                } else {
                    System.out.println("This person doesn't exist!");
                }
                break;
            }
            case DELETE : {
                Record rec = storage.deleteRecord(query.rec.name);
                if (rec != null) {
                    System.out.println("Person " + rec.name + " with number " + rec.number + " was deleted") ;
                } else {
                    System.out.println("This person doesn't exist!");
                }
                break;
            }
            case UPDATE : {
                if (storage.addRecord(query.rec)) {
                    System.out.println("Record for person " + query.rec.name +" was updated");
                } else {
                    System.out.println("The record with this person was created");
                }
                break;
            }
            case ERROR : {
                System.out.println("ERROR! Try again!");
                break;
            }
        }

    }