Getting the Object value and add to Arraylist and then I have to check arraylist contains string or not.
Below is the POJO Class, finally this will get as Object
public class OrderTypeFeature{
public OrderTypeFeature(ODataEntity entity){
create(entity);
}
private String OrderType;
private String Feature;
public String getOrderType() {
return OrderType;
}
public void setOrderType(String orderType) {
OrderType = orderType;
}
public String getFeature() {
return Feature;
}
public void setFeature(String feature) {
Feature = feature;
}
public static ArrayList<OrderTypeFeature> getOrderTypeFeatures(String orderType){
ArrayList<OrderTypeFeature> orderTypeFeatures = new ArrayList<>();
ResponseObject result = new ResponseObject(ConfigManager.Status.Error);
try {
String resourcePath = Collections.LT_ORDERTYPEFEATURESET+"?$filter=(OrderType eq '"+ orderType +"')";
result = DataHelper.getInstance().getEntities(resourcePath, StoreSettings.Stores.MdLV);
if(!result.isError()){
List<ODataEntity> entities = (List<ODataEntity>) result.Content();
for (ODataEntity entity : entities){
orderTypeFeatures.add(new OrderTypeFeature(entity));
}
}
}catch (Exception e){
result.setMessage(e.getMessage());
DliteLogger.WriteLog(OrderTypeFeature.class, AppSettings.LogLevel.Error, e.getMessage());
}
return orderTypeFeatures;
}
}
Below are the links which I referred How to retrieve objects values stored in a Java ArrayList but didn't worked out
I have to get the Object Value to ArrayList and then I have to compare the Object value with the String without using For loop. Please help me guys.Thanks in Advance.