Example usage for org.apache.commons.lang NullArgumentException NullArgumentException

List of usage examples for org.apache.commons.lang NullArgumentException NullArgumentException

Introduction

In this page you can find the example usage for org.apache.commons.lang NullArgumentException NullArgumentException.

Prototype

public NullArgumentException(String argName) 

Source Link

Document

Instantiates with the given argument name.

Usage

From source file:org.openhab.binding.russound.internal.rio.source.RioSourceProtocol.java

/**
 * Helper method to handle any media management change. If the channel is the INFO text channel, we delegate to
 * {@link #handleMMInfoText(String)} instead. This helper method will simply get the next MM identifier and send the
 * json representation out for the channel change (this ensures unique messages for each MM notification)
 *
 * @param channelId a non-null, non-empty channelId
 * @param value the value for the channel
 * @throws IllegalArgumentException if channelID is null or empty
 *///from  w  w w  . java 2 s  .  com
private void handleMMChange(String channelId, String value) {
    if (StringUtils.isEmpty(channelId)) {
        throw new NullArgumentException("channelId cannot be null or empty");
    }

    final AtomicInteger ai = mmSeqNbrs.get(channelId);
    if (ai == null) {
        logger.error("Channel {} does not have an ID configuration - programmer error!", channelId);
    } else {

        if (channelId.equals(RioConstants.CHANNEL_SOURCEMMINFOTEXT)) {
            value = handleMMInfoText(value);
            if (value == null) {
                return;
            }
        }

        final int id = ai.getAndIncrement();

        final String json = gson.toJson(new IdValue(id, value));
        stateChanged(channelId, new StringType(json));
    }
}

From source file:org.openhab.io.squeezeserver.SqueezeServer.java

public synchronized SqueezePlayer getPlayer(String playerId) {
    if (StringUtils.isEmpty(playerId))
        throw new NullArgumentException("playerId");
    String key = playerId.toLowerCase();
    if (!playersById.containsKey(key)) {
        logger.warn("No player exists for '{}'", playerId);
        return null;
    }/* w w w . j av a  2s.c o  m*/
    return playersById.get(key);
}

From source file:org.openlmis.fulfillment.service.TransferPropertiesService.java

/**
 * Retrieves TransferProperties for given facility.
 *
 * @param facilityId id of facility./*w  ww .j  a  va2 s. c  o m*/
 * @return TransferProperties entity with matching facility.
 */
public TransferProperties getByFacility(UUID facilityId) {
    if (facilityId == null) {
        throw new NullArgumentException("facilityId");
    }

    return transferPropertiesRepository.findFirstByFacilityId(facilityId);
}

From source file:org.openmailarchive.Entities.Mail.java

public void setMailid(String mailid) throws NullArgumentException {
    if (mailid == null)
        throw new NullArgumentException("mailid cannot be null");
    this.mailid = mailid;
}

From source file:org.openmailarchive.Entities.Mail.java

public void setFilepath(String filepath) throws NullArgumentException {
    if (filepath == null)
        throw new NullArgumentException("filepath cannot be null");
    this.filepath = filepath;
}

From source file:org.openmailarchive.Entities.Mail.java

public void setMailfrom(String mailfrom) throws NullArgumentException {
    if (mailfrom == null)
        throw new NullArgumentException("mailfrom cannot be null");
    this.mailfrom = mailfrom;
}

From source file:org.openmailarchive.Entities.Mail.java

public void setDt(Timestamp dt) throws NullArgumentException {
    if (dt == null)
        throw new NullArgumentException("dt cannot be null");
    this.dt = dt;
}

From source file:org.openmailarchive.Entities.Mail.java

public void setSubject(String subject) throws NullArgumentException {
    if (subject == null)
        throw new NullArgumentException("subject cannot be null");
    this.subject = subject;
}

From source file:org.openmailarchive.Entities.Mail.java

public void setBody(String body) throws NullArgumentException {
    if (body == null)
        throw new NullArgumentException("body cannot be null");
    this.body = body;
}

From source file:org.petalslink.dsb.kernel.registry.BaseEndpointRegistry.java

public ServiceEndpoint[] getExternalEndpointsForService(QName serviceName)
        throws org.ow2.petals.jbi.messaging.registry.RegistryException {

    if (this.log.isDebugEnabled()) {
        this.log.debug(
                "Entering method : getExternalEndpointsForService with params serviceName = " + serviceName);
    }/*from ww w .  j  av a  2 s. c o m*/

    if (serviceName == null) {
        throw new NullArgumentException("serviceName");
    }

    ServiceEndpoint[] result = new ServiceEndpoint[0];
    Query q = new Query();
    q.setService(serviceName);
    q.setType(EndpointType.EXTERNAL.toString().toLowerCase());

    try {
        List<Endpoint> eps = this.client.lookup(q, false);
        if (eps != null) {
            List<org.ow2.petals.jbi.messaging.endpoint.ServiceEndpoint> list = new ArrayList<org.ow2.petals.jbi.messaging.endpoint.ServiceEndpoint>(
                    eps.size());
            for (Endpoint endpoint : eps) {
                JBIServiceEndpointImpl ep = new JBIServiceEndpointImpl();
                ep.setType(EndpointType.EXTERNAL);
                ep.setStringDescription(endpoint.getDescription());
                ep.setEndpointName(endpoint.getName().toString());
                List<QName> interfaces = new ArrayList<QName>(1);
                interfaces.add(endpoint.getInterface());
                ep.setInterfacesName(interfaces);
                ep.setServiceName(endpoint.getService());
                ep.getLocation().setComponentName(endpoint.getComponent());
                ep.getLocation().setContainerName(endpoint.getContainer());
                ep.getLocation().setSubdomainName(endpoint.getSubdomain());
                list.add(ep);
            }
            result = list.toArray(new org.ow2.petals.jbi.messaging.endpoint.ServiceEndpoint[list.size()]);
        }
    } catch (RegistryException e) {
        throw new org.ow2.petals.jbi.messaging.registry.RegistryException(e.getMessage());
    }
    return result;
}