java将If条件转换为HashSet对象
有谁能帮我写下面的代码在“如果条件”设置对象
if (!(Aaa.HELLO.equals(city.getcityMethod()) ||
Aaa.BANGALORE.equals(city.getcityMethod()))
|| !((Bbb.MYSORE.equals(city.getcityTypeInformation().getCitypurspose()))
|| (CityPurpose.RETRIED.equals(city.getCityTypeInformation().getCitypurspose(()))
|| (CityPurpose.SOCIAL.equals(getcityMethod.getCityTypeInformation().getCitypurspose()))
|| (CityPurpose.COMPANY.equals(getcityMethod.getCityTypeInformation().getCitypurspose()))))
有些是这样的:
CONVERTING =unmodifiable::< SET>(HashSet( //here using if condition logic);
所以CONVERTING
可以这样使用:
if( CONVERTING) { // some logic}
# 1 楼答案
那么,把你想要的数据放在适当类型的相关集合中,然后检查这些集合是否包含传递的数据: