Example usage for java.lang Long equals

List of usage examples for java.lang Long equals

Introduction

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

Prototype

public boolean equals(Object obj) 

Source Link

Document

Compares this object to the specified object.

Usage

From source file:com.cemeterylistingsweb.services.impl.ViewListingByCemeteryImpl.java

@Override
public List<PublishedDeceasedListing> findListingByCemetery(Long cemId) {
    ///*from www.jav  a 2  s.c om*/
    List<PublishedDeceasedListing> deceasedList = deadRepo.findAll();
    List<PublishedDeceasedListing> Listings = new ArrayList();
    for (PublishedDeceasedListing listing : deceasedList) {
        if (cemId.equals(listing.getCemeteryID())) {//listing.getCemeteryID().equals(cemId)){
            //add to list
            Listings.add(listing);
        }
    }
    return Listings;
}

From source file:com.jostrobin.battleships.view.frames.GameFrame.java

public void changeCurrentPlayer(Long playerId) {
    gamePanel.changeCurrentPlayer(playerId);
    battleFieldPanel.setCurrent(playerId.equals(this.playerId));
}

From source file:com.square.adherent.noyau.util.PersonneUtil.java

/**
 * Filtre les tlphones correspondant  la nature passe en paramtre.
 * @param telephones la liste complte de tlphones
 * @param idNatureTelephone la nature de tlphone recherche
 * @return la liste des tlphones filtrs correspondant  la nature passe en paramtre
 *//*w  w w.  j ava 2  s .  c  om*/
public List<TelephoneDto> getTelephonesByNature(List<TelephoneDto> telephones, Long idNatureTelephone) {
    final List<TelephoneDto> telephonesFiltres = new ArrayList<TelephoneDto>();
    if (telephones != null && !telephones.isEmpty() && idNatureTelephone != null) {
        for (TelephoneDto telephone : telephones) {
            if (idNatureTelephone.equals(telephone.getNature().getIdentifiant())) {
                telephonesFiltres.add(telephone);
            }
        }
    }
    return telephonesFiltres;
}

From source file:com.egt.core.db.ddl.MapaClases.java

public Map getMap(Long clase) throws SQLException {
    String filtro = clase == null || clase.equals("") ? null : "id_clase_objeto=" + clase;
    return this.addClases(filtro);
}

From source file:Cursling.deleteMonitor.java

public String _deleteMonitor(String monitor_name) {
    isdeleted = false;//from w w w  .  j  av  a2  s  . co  m
    try {
        File inFile = new File(input_file_del);

        if (!inFile.isFile()) {
            logger.info("Failed to Delete. Data file not found.");
            return ("failed");
        }
        storeUpdate = new File(input_file_del);
        File tempFile = new File(inFile.getAbsolutePath() + ".tmp");
        BufferedReader br = new BufferedReader(new FileReader(input_file_del));
        PrintWriter pw = new PrintWriter(new FileWriter(tempFile));
        String line = null;

        while ((line = br.readLine()) != null) {
            if (!line.equalsIgnoreCase("")) {
                String tmp_linee = line.replaceAll("\\\\", "");
                if (tmp_linee.startsWith(monitor_name + " = ht")
                        || tmp_linee.startsWith(monitor_name + "=ht")) {
                    isdeleted = true;
                    pw.flush();
                } else if (tmp_linee.startsWith(monitor_name.toLowerCase() + " = ena")
                        || tmp_linee.startsWith(monitor_name.toLowerCase() + " = dis")
                        || tmp_linee.startsWith(monitor_name.toLowerCase() + "=ena")
                        || tmp_linee.startsWith(monitor_name.toLowerCase() + "=dis")) {
                    isdeleted = true;
                    pw.flush();
                } else {
                    pw.println(line);
                    pw.flush();
                }

            } else {
            }
        }

        pw.close();
        br.close();

        //Rename the new file to the filename the original file had.
        if (tempFile.canRead()) {
            Long before = storeUpdate.lastModified();
            FileUtils.copyFile(tempFile, storeUpdate);
            Long after = storeUpdate.lastModified();
            if (before.equals(after)) {
                logger.info("failed to delete Monitor " + monitor_name);
                return ("failed");
            } else if (isdeleted == true && deleteOutput(monitor_name) == true) {
                logger.info("Monitor " + monitor_name + " Deleted.");
                return ("deleted");
            } else if (isdeleted == true && deleteOutput(monitor_name) == false) {
                logger.info("Monitor " + monitor_name + " Deleted. But output will removed in Sometime.");
                return ("deleted");
            } else {
                logger.info("Failed to delete Monitor " + monitor_name + " . Monitor not found.");
                return ("not_found");
            }
        } else {
            logger.info("failed to delete Monitor " + monitor_name);
            return ("failed");
        }
    } catch (FileNotFoundException ex) {
        logger.info("failed to delete Monitor " + monitor_name);
        logger.error("Error1 : " + ex);
        return ("failed");
    } catch (IOException ex) {
        logger.info("failed to delete Monitor " + monitor_name);
        logger.error("Error2 : " + ex);
        return ("failed");
    }
}

From source file:com.mobileman.projecth.web.util.ConnectionsHelper.java

private UserConnection loadConnectionForConfirm(Long connid, Long userId) {
    UserConnection uc = loadConnection(connid);
    if (uc != null) {
        if (userId.equals(uc.getUser().getId())) {
            return uc;
        }/*from w w w. j  a  v a  2 s  .  c  om*/
    }
    return null;
}

From source file:com.mobileman.projecth.web.util.ConnectionsHelper.java

private UserConnection loadConnectionForCancel(Long connid, Long userId) {
    UserConnection uc = loadConnection(connid);
    if (uc != null) {
        if (userId.equals(uc.getUser().getId()) || userId.equals(uc.getOwner().getId())) {
            return uc;
        }/*from ww  w. j a  v a  2s  .c o m*/
    }
    return null;
}

From source file:data.dao.PropertyNameDao.java

public List<PropertyName> getUniquePropertyNames(Long propId) throws Exception {
    if (propId == null) {
        throw new Exception("propId is null!");
    }/*  w  w  w.j  a va2s  . c  o m*/
    List<PropertyName> res = new ArrayList();
    if (!propId.equals((long) 0)) {
        CarProperty cp = carPropertyDao.find(propId);
        if (cp != null) {
            String hql = "select distinct pn from PropertyName pn where pn.carProperty.cpId=:propId group by pn.propertyNameValue order by pn.propertyNameValue";
            Query query = currentSession().createQuery(hql).setParameter("propId", propId);
            return query.list();
        }
    } else if (propId.equals((long) 0)) {
        String hql = "select distinct pn from PropertyName pn group by pn.propertyNameValue order by pn.propertyNameValue";
        Query query = currentSession().createQuery(hql);
        return query.list();
    }
    return res;
}

From source file:org.opencron.server.service.JobService.java

public boolean checkJobOwner(Long userId, HttpSession session) {
    return OpencronTools.isPermission(session) || userId.equals(OpencronTools.getUserId());
}

From source file:com.bsb.cms.moss.controller.auth.SysUserController.java

/**
 * // ww  w .j  a  v  a 2 s. c o m
 * 
 * @param sysUserId
 * @return
 */
@RequestMapping("delete.htm")
@ResponseBody
public JSONResultDTO delete(Long sysUserId) {
    JSONResultDTO result = new JSONResultDTO();
    try {
        if (sysUserId.equals(ADMIN_ID)) {
            result.setMessage("??");
            result.setResult(JSONResultDTO.ERROR);
        } else {
            sysUserService.deleteById(sysUserId);
            log(OperateTypeEnum.DELETE_OPERATOR, "?id:" + sysUserId, "?");
            result.setMessage("?");
            result.setResult(JSONResultDTO.SUCCESS);
        }
    } catch (Exception e) {
        result.setMessage("");
        result.setResult(JSONResultDTO.ERROR);
        log.error(e.getMessage());
    }
    return result;
}