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:org.springframework.cloud.consul.binder.EventService.java

/**
 * from https://github.com/hashicorp/consul/blob/master/watch/funcs.go#L169-L194
 *///from   ww w .  java  2  s.c om
protected List<Event> filterEvents(List<Event> toFilter, Long lastIndex) {
    List<Event> events = toFilter;
    if (lastIndex != null) {
        for (int i = 0; i < events.size(); i++) {
            Event event = events.get(i);
            Long eventIndex = event.getWaitIndex();
            if (lastIndex.equals(eventIndex)) {
                events = events.subList(i + 1, events.size());
                break;
            }
        }
    }
    return events;
}

From source file:technology.tikal.gae.http.cache.AbstractCacheController.java

protected boolean safeEqualsLong(Long a, Long b) {
    if (a == null && b == null) {
        return true;
    }/*from   ww  w  . j  ava2 s . c  o  m*/
    if (a == null || b == null) {
        return false;
    }
    return a.equals(b);
}

From source file:bql.util.JsonComparator.java

private boolean isEqualsLong(Long a, Long b) {
    if (a == null ^ b == null) {
        return false;
    } else if (a == null && b == null) {
        return true;
    }//ww  w.jav  a2s. c o  m
    return a.equals(b);
}

From source file:net.solarnetwork.node.settings.playpen.SettingsPlaypen.java

public void setWeatherLocationId(Long weatherLocationId) {
    if (this.weatherLocation != null && weatherLocationId != null
            && !weatherLocationId.equals(this.weatherLocation.getLocationId())) {
        this.weatherLocation = null; // set to null so we re-fetch from server
    }//from  w w  w  .j av  a2 s .co m
    this.weatherLocationId = weatherLocationId;
}

From source file:org.openregistry.core.domain.jpa.sor.JpaSorPersonImpl.java

public synchronized SorName findNameByNameId(final Long id) {
    for (final SorName name : this.names) {
        final Long nameId = name.getId();
        if (nameId != null && nameId.equals(id)) {
            return name;
        }//from www.  ja  v  a 2 s .  c o  m
    }
    return null;
}

From source file:de.iai.ilcd.webgui.controller.ui.ProcessHandler.java

/**
 * {@inheritDoc}/* w w w.  j a v  a2  s  .  c  o  m*/
 */
@Override
protected void datasetLoaded(Process p) {
    // Load input products
    List<Exchange> tmp = p.getExchanges(ExchangeDirection.INPUT.name());
    this.inputProducts = new ArrayList<Flow>();
    for (Exchange e : tmp) {
        if (e.getFlow() != null && TypeOfFlowValue.PRODUCT_FLOW.equals(e.getFlow().getType())) {
            this.inputProducts.add(e.getFlow());
        }
    }

    // Load co-products
    tmp = p.getExchanges(ExchangeDirection.OUTPUT.name());
    this.coProducts = new ArrayList<Flow>();
    // named loop (due to continue from inner loop)
    coProdLoop: for (Exchange e : tmp) {
        if (e.getFlow() != null && TypeOfFlowValue.PRODUCT_FLOW.equals(e.getFlow().getType())) {
            // check if this exchange flow is contained in the reference exchange list
            Long id = e.getFlow().getId();
            for (Exchange refEx : p.getReferenceExchanges()) {
                if (refEx.getFlow() != null && id.equals(refEx.getFlow().getId())) {
                    // trigger next loop from !! outer !! loop
                    continue coProdLoop;
                }
            }
            // flow was not in reference exchange list
            this.coProducts.add(e.getFlow());
        }
    }
}

From source file:com.vmware.appfactory.datastore.DatastoreClientService.java

/**
 * Check to see if a datastore is the default (for output).
 * @param dsId Datastore to check.// ww w. j ava2 s. com
 * @return True if a default has been selected, and it's this one.
 */
public boolean isDefault(Long dsId) {
    if (hasDefault()) {
        try {
            String str = _config.getString(ConfigRegistryConstants.DATASTORE_DEFAULT_OUTPUT_ID);
            Long defId = Long.valueOf(str);
            return defId.equals(dsId);
        } catch (NumberFormatException ex) {
            /* The default was not an ID */
        }
    }
    return false;
}

From source file:io.getlime.push.controller.web.WebAdminController.java

@RequestMapping(value = "web/admin/app/{id}/ios/remove/do.submit", method = RequestMethod.POST)
public String actionRemoveIosCredentials(@Valid RemoveIosCredentialsForm form, @PathVariable Long id,
        BindingResult bindingResult) {//w w w.ja va  2s  .c  o  m
    if (bindingResult.hasErrors() || (id == null || !id.equals(form.getId()))) {
        return "error";
    }
    final AppCredentialsEntity appCredentialsEntity = appCredentialsRepository.findOne(form.getId());
    appCredentialsEntity.setIosPrivateKey(null);
    appCredentialsEntity.setIosTeamId(null);
    appCredentialsEntity.setIosKeyId(null);
    appCredentialsEntity.setIosBundle(null);
    AppCredentialsEntity newAppCredentialsEntity = appCredentialsRepository.save(appCredentialsEntity);
    return "redirect:/web/admin/app/" + newAppCredentialsEntity.getId() + "/edit";
}

From source file:lu.lippmann.cdb.graph.GraphUtil.java

/**
 * /*  w  ww .j  a  va2s. c o m*/
 * @param graph
 * @param lastIdGroup
 * @param o
 */
public static void createGroupFlags(final GraphWithOperations graph, Long lastIdGroup, GraphOperation o) {
    if (o.getIdGroup() != null) {
        if (lastIdGroup == null) {
            if (o.getIdGroup() >= 0) {
                graph.startGroupOperation();
            } else {
                graph.startHistoryRevertOperation();
            }
        } else if (!lastIdGroup.equals(o.getIdGroup())) {
            if (lastIdGroup >= 0) {
                graph.stopGroupOperation();
            } else {
                graph.stopHistoryRevertOperation();
            }
            if (o.getIdGroup() >= 0) {
                graph.startGroupOperation();
            } else {
                graph.startHistoryRevertOperation();
            }
        }
    } else {
        if (lastIdGroup != null && lastIdGroup >= 0) {
            graph.stopGroupOperation();
        } else {
            graph.stopHistoryRevertOperation();
        }
    }
}

From source file:org.energyos.espi.common.service.impl.SubscriptionServiceImpl.java

@Override
public Long findRetailCustomerId(Long subscriptionId, Long usagePointId) {
    Long result = null;
    Subscription s = resourceService.findById(subscriptionId, Subscription.class);
    result = s.getRetailCustomer().getId();
    if (result.equals(0L)) {
        // we have a subscription that is based upon client credentials
        // now we must find the actual retail customer associated with
        // this particular usagePoint
        result = resourceService.findById(usagePointId, UsagePoint.class).getRetailCustomer().getId();
    }/*from   w  ww  .j  av a 2s . c o  m*/
    s.getAuthorization().getRetailCustomer();
    return result;
}