Example usage for java.lang Integer equals

List of usage examples for java.lang Integer equals

Introduction

In this page you can find the example usage for java.lang Integer equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Compares this object to the specified object.

Usage

From source file:com.aurel.track.fieldType.bulkSetters.ItemPickerBulkSetter.java

/**
 * Add the value to the existing ones// ww  w  .jav a 2  s  .  c o m
 * @param actualValue
 * @param addedValue
 * @return
 */
private static Object[] removeItem(Object[] actualValue, Integer removeValue) {
    Set<Integer> set = new HashSet<Integer>();
    if (actualValue != null) {
        for (Object value : actualValue) {
            if (!removeValue.equals(value)) {
                set.add((Integer) value);
            }
        }
    }
    return set.toArray();
}

From source file:com.aurel.track.admin.customize.category.filter.MenuitemFilterBL.java

/**
 * Actualize the menu item query from change subscribe
 * @param personID//  w ww  .j a va  2  s  .c  o  m
 * @param filterID
 * @param includeInMenu
 * @return
 */
static boolean actualizeMenuItemQuery(Integer personID, Integer filterID, boolean includeInMenu) {
    boolean changed = false;
    TMenuitemQueryBean menuitemQueryBean = loadByPersonAndQuery(personID, filterID);
    if (!includeInMenu) {
        if (menuitemQueryBean == null) {
            //nothing changed
            return false;
        } else {
            changed = EqualUtils.notEqual(menuitemQueryBean.isIncludeInMenu(), includeInMenu);
            Integer styleField = menuitemQueryBean.getCSSStyleField();
            if (styleField == null || styleField.equals(IssueFilterFacade.NONE_STYLE_FIELD)) {
                //no style field exists, delete menu entry from db
                delete(personID, filterID);
            } else {
                menuitemQueryBean.setIncludeInMenu(includeInMenu);
                save(menuitemQueryBean);
            }
        }
    } else {
        if (menuitemQueryBean == null) {
            //add as new
            menuitemQueryBean = new TMenuitemQueryBean();
            menuitemQueryBean.setPerson(personID);
            menuitemQueryBean.setQueryKey(filterID);
            changed = true;
        } else {
            changed = EqualUtils.notEqual(menuitemQueryBean.isIncludeInMenu(), includeInMenu);
        }
        menuitemQueryBean.setIncludeInMenu(includeInMenu);
        save(menuitemQueryBean);
    }
    return changed;
}

From source file:org.unidle.test.Conditions.java

public static Condition<Object> hasRank(final Integer rank) {
    return new Condition<Object>(format("has rank: %d", rank)) {
        @Override/*from www  . ja va2s .c  o  m*/
        public boolean matches(final Object value) {
            return rank.equals(getField(value, "rank"));
        }
    };
}

From source file:edu.ku.brc.specify.tasks.services.PickListUtils.java

public static boolean equals(Integer v1, Integer v2) {
    return (v1 == null ? v2 == null : v1.equals(v2));
}

From source file:org.unidle.test.Conditions.java

public static Condition<Object> hasTaskPeople(final Integer taskPeople) {
    return new Condition<Object>(format("has task people: %s", taskPeople)) {
        @Override//from  www .  ja  v a 2 s  .c o  m
        public boolean matches(final Object value) {
            return taskPeople.equals(getField(value, "taskPeople"));
        }
    };
}

From source file:org.unidle.test.Conditions.java

public static Condition<Object> hasTaskDuration(final Integer taskDuration) {
    return new Condition<Object>(format("has task duration: %s", taskDuration)) {
        @Override//from ww w  . j av  a  2  s . c o m
        public boolean matches(final Object value) {
            return taskDuration.equals(getField(value, "taskDuration"));
        }
    };
}

From source file:org.unidle.test.Conditions.java

public static Condition<Object> hasSummaryDuration(final Integer summaryDuration) {
    return new Condition<Object>(format("has summary duration: %s", summaryDuration)) {
        @Override/*www  .j  av  a 2s  . c o  m*/
        public boolean matches(final Object value) {
            return summaryDuration.equals(getField(value, "summaryDuration"));
        }
    };
}

From source file:com.aurel.track.admin.customize.category.filter.MenuitemFilterBL.java

/**
 * Actualizes the menu item query//ww  w.  ja v a  2  s.  c om
 * @param personID
 * @param filterID
 * @param includeInMenu
 * @param styleField
 */
static boolean actualizeMenuItemQuery(Integer personID, Integer filterID, boolean includeInMenu,
        Integer styleField) {
    boolean changed = false;
    TMenuitemQueryBean menuitemQueryBean = loadByPersonAndQuery(personID, filterID);
    if (!includeInMenu && (styleField == null || styleField.equals(IssueFilterFacade.NONE_STYLE_FIELD))) {
        if (menuitemQueryBean == null) {
            //nothing changed
            return false;
        } else {
            //delete from menu
            delete(personID, filterID);
            return true;
        }
    } else {
        if (menuitemQueryBean == null) {
            //add as new
            menuitemQueryBean = new TMenuitemQueryBean();
            menuitemQueryBean.setPerson(personID);
            menuitemQueryBean.setQueryKey(filterID);
            changed = true;
        } else {
            changed = EqualUtils.notEqual(menuitemQueryBean.isIncludeInMenu(), includeInMenu);
        }
        menuitemQueryBean.setCSSStyleField(styleField);
        menuitemQueryBean.setIncludeInMenu(includeInMenu);
        save(menuitemQueryBean);
        return changed;
    }
}

From source file:com.aurel.track.admin.customize.treeConfig.field.FieldBL.java

/**
 * Gets the custom select fields: exclude the custom pickers
 * @return//  w w w .  j  a  va  2s  .  c o  m
 */
public static List<Integer> getCustomPickerFieldIDs(Integer systemFieldID) {
    List<Integer> customSelectFieldIDs = new LinkedList<Integer>();
    List<TFieldBean> customFieldBeans = FieldBL.loadCustom();
    if (customFieldBeans != null && !customFieldBeans.isEmpty()) {
        for (TFieldBean fieldBean : customFieldBeans) {
            Integer fieldID = fieldBean.getObjectID();
            IFieldTypeRT fieldTypeRT = FieldTypeManager.getFieldTypeRT(fieldID);
            if (fieldTypeRT != null && fieldTypeRT.isCustom()) {
                ICustomFieldTypeRT customFieldTypeRT = (ICustomFieldTypeRT) fieldTypeRT;
                if (customFieldTypeRT.isCustomSelect() && customFieldTypeRT.isLookup()) {
                    CustomSelectBaseRT customSelectBaseRT = null;
                    try {
                        customSelectBaseRT = (CustomSelectBaseRT) customFieldTypeRT;
                    } catch (Exception e) {
                        LOGGER.debug(ExceptionUtils.getStackTrace(e));
                    }
                    if (customSelectBaseRT != null) {
                        if (customSelectBaseRT.isCustomPicker()) {
                            CustomPickerRT customPickerRT = (CustomPickerRT) customSelectBaseRT;
                            if (customPickerRT != null) {
                                Integer systemOptionType = customPickerRT.getSystemOptionType();
                                if (systemOptionType != null && systemOptionType.equals(systemFieldID)) {
                                    LOGGER.debug("Custom picker field based on " + systemFieldID + " found "
                                            + fieldID);
                                    customSelectFieldIDs.add(fieldID);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    return customSelectFieldIDs;
}

From source file:com.synconset.ImageFetcher.java

/**
 * Returns true if the current download has been canceled or if there was no
 * download in progress on this image view. Returns false if the download in
 * progress deals with the same url. The download is not stopped in that
 * case./*w  ww  . j a va 2 s .co  m*/
 */
private static boolean cancelPotentialDownload(Integer position, ImageView imageView) {
    BitmapFetcherTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);
    long origId = getOrigId(imageView);

    if (bitmapDownloaderTask != null) {
        Integer bitmapPosition = bitmapDownloaderTask.position;
        if ((bitmapPosition == null) || (!bitmapPosition.equals(position))) {
            // Log.d("DAVID", "Canceling...");
            MediaStore.Images.Thumbnails.cancelThumbnailRequest(imageView.getContext().getContentResolver(),
                    origId, 12345);
            bitmapDownloaderTask.cancel(true);
        } else {
            return false;
        }
    }
    return true;
}