Write a method checkPerson, take the entity class Person, return the Boolean value [closed]

There is an entity class Ga1400Person that contains the person name, and idNumber fields

public class Ga1400Person {
   private String name;
   private String idNumber;
}

The characteristic string of a layout object is defined as follows:

  1. using multiple key-value pairs ((Key1=Value1) and (Key2=Value2)) or (Key3=Value3) formula to represent the refinement conditions corresponding to the category;
  2. The value of Key is derived from the PropertyTypeEnum enum.
    3, support fuzzy layout control: regular expression symbol “? Common regular expression characters such as, *, and, or, () “;
    4, the punctuation symbols involved in the formula are English half corner;

The PropertyType enumeration is as follows:

public enum PropertyTypeEnum {
   PERSON_NAME(1, "person name"),
   ID_NUMBER(2, "ID number"),
   PLATE_NO(3, "license plate"),
   PLATE_COLOR(4, "license plate color"),
   VEHICLE_BRAND(5, "Vehicle brand"),
   VEHICLE_MODEL(6, "Vehicle model"),
   VEHICLE_STYLES(7, "Vehicle year"),
   KEYWORK(8, "keyword");

   private Integer value;

   private String desc;
}

Write a method checkPerson, take the entity class Ga1400Person, return the Boolean value,
Resolve whether the Person name and idNumber of the entity class Person conform to the regular expression rules of the feature string of the controller object. If yes, return true. If no, return false

Illustrate by example
(1= white) and (2=123456)
If the character string of the preceding control object is correctly interpreted as the name is blank and the idnumber is 123456, return true

((1= white) and (2=123456)) or (1= three)
The above feature string is correctly interpreted as true if the name is blank and the ID number is 123456, or if the name is three

Illustrate by example

// The following character string of a layout object is featureString. // If the name is blank and the ID number is 123456, or the name is three, the value is true
String featureString = "((1= nothing) and (2=123456)) or (1= three pieces)";

Test method expectation

public static void main(String[] args) {
   // The character string of the controller object
   String featureString = "((1= nothing) and (2=123456)) or (1= three pieces)";

   // Create a Ga1400Person instance
   Ga1400Person person1 = new Ga1400Person(" white up ", "123456");
   Ga1400Person person2 = new Ga1400Person(" Zhang SAN ", "789012");

   // Check whether the feature string rules of the controlled object are complied with
   boolean result1 = checkPerson(person1, featureString);
   boolean result2 = checkPerson(person2, featureString);
   System.out.println("Person1 conforms to the feature string rule of the controller object: "+ result1);
   System.out.println("Person2 conforms to the character string rule of the controller object: "+ result2);
}

Expect both result1 and result2 to be true

New contributor

JourWon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật