正規表現を使用せずに以下のコードを書くにはどうすればよいですか?
public static boolean validateCode(String code){
    boolean hasAtLeastOneNumber = Pattern.compile("[0-9].*[0-9]")
                                         .matcher(code).find();
    boolean hasAtLeastTwoLetters = Pattern.compile("[a-zA-Z].*[a-zA-Z]")
                                          .matcher(code).find();
    boolean hasAtLeastOneHyphen = Pattern.compile("-")
                                         .matcher(code).find();
}