Example usage for org.springframework.util Assert hasLength

List of usage examples for org.springframework.util Assert hasLength

Introduction

In this page you can find the example usage for org.springframework.util Assert hasLength.

Prototype

@Deprecated
public static void hasLength(@Nullable String text) 

Source Link

Document

Assert that the given String is not empty; that is, it must not be null and not the empty String.

Usage

From source file:com.joyveb.dbpimpl.cass.prepare.option.DefaultOption.java

protected void setName(String name) {
    Assert.hasLength(name);
    this.name = name;
}

From source file:com.graphaware.importer.stats.LoggingStatisticsCollector.java

/**
 * Create a new statistics collector.//from  w  w  w  . ja va 2s .c o m
 *
 * @param name name of the stats, must not be <code>null</code> or empty.
 */
public LoggingStatisticsCollector(String name) {
    Assert.hasLength(name);

    this.name = name;
}

From source file:org.jcf.graphicMessage.GraphicObjectFactory.java

/**
 * creating new LineImpl object with new id and a list of locations
 * @param nikName Nikname inside room//from w  w  w . j av  a2 s  .com
 * @param room name of the room
 * @param locs Location instance
 * @return new created LineImpl object
 */
public static Line createLine(String nikName, String room, List<Location> locs) {
    Assert.hasLength(nikName);
    Assert.hasLength(room);
    Assert.notNull(locs);

    Id id = IdFactory.getNextId(room, nikName);
    Line l = new LineImpl(id);
    l.addAllLocation(locs);
    return l;
}

From source file:nz.co.senanque.locking.simple.SimpleLock.java

public SimpleLock(String lockName, LockFactory.LockType type, String comment, int sleepTime,
        SimpleLockFactory factory) {//  w  w w. j  a va2s.  co m
    Assert.hasLength(lockName);
    m_lockName = lockName;
    m_comment = comment;
    m_type = type;
    m_sleepTime = sleepTime;
    m_factory = factory;
}

From source file:io.kahu.hawaii.service.io.LocationHelper.java

public void setHawaiiCsvHome(String hawaiiCsvHome) {
    Assert.hasLength(hawaiiCsvHome);
    if (!hawaiiCsvHome.endsWith(File.separator)) {
        hawaiiCsvHome += File.separator;
    }//  www .ja v  a  2  s .  c  om
    this.hawaiiCsvHome = hawaiiCsvHome;
}

From source file:com.graphaware.importer.data.DynamicData.java

/**
 * Create new data./* ww w.  j  a v a2s  .  com*/
 *
 * @param name name of the data. Must not be <code>null</code> or empty.
 */
protected DynamicData(String name) {
    Assert.hasLength(name);

    this.name = name;
}

From source file:com.sshdemo.common.report.manage.service.ChartReportService.java

@Override
public Long updChartReport(ChartReport chartReport) {
    Assert.notNull(chartReport);/* www  .  ja v a 2 s  . com*/
    Assert.hasLength(chartReport.getChartSql());

    ChartReport entity = chartReportDAO.get(chartReport.getId());

    entity.setName(chartReport.getName());
    entity.setBaseDS(chartReport.getBaseDS());
    entity.setType(chartReport.getType());
    entity.setShowTooltips(chartReport.getShowTooltips());
    entity.setChartTitle(chartReport.getChartTitle());
    entity.setFontName(chartReport.getFontName());
    entity.setFontSize(chartReport.getFontSize());
    entity.setFontStyle(chartReport.getFontStyle());
    entity.setHorizAxisLabel(chartReport.getHorizAxisLabel());
    entity.setVertAxisLabel(chartReport.getVertAxisLabel());
    entity.setDataFontName(chartReport.getDataFontName());
    entity.setDataFontSize(chartReport.getDataFontSize());
    entity.setDataFontStyle(chartReport.getDataFontStyle());
    entity.setAxisFontName(chartReport.getAxisFontName());
    entity.setAxisFontSize(chartReport.getAxisFontSize());
    entity.setAxisFontStyle(chartReport.getAxisFontStyle());
    entity.setAxisTickFontName(chartReport.getAxisTickFontName());
    entity.setAxisTickFontSize(chartReport.getAxisTickFontSize());
    entity.setAxisTickFontStyle(chartReport.getAxisTickFontStyle());
    entity.setTickLabelRotate(chartReport.getTickLabelRotate());
    entity.setShowLegend(chartReport.getShowLegend());
    entity.setLegendPosition(chartReport.getLegendPosition());
    entity.setLegendFontName(chartReport.getLegendFontName());
    entity.setLegendFontSize(chartReport.getLegendFontSize());
    entity.setLegendFontStyle(chartReport.getLegendFontStyle());
    entity.setChartHeight(chartReport.getChartHeight());
    entity.setChartWidth(chartReport.getChartWidth());
    entity.setBgColorB(chartReport.getBgColorB());
    entity.setBgColorG(chartReport.getBgColorG());
    entity.setBgColorR(chartReport.getBgColorR());
    entity.setRemarks(chartReport.getRemarks());
    entity.setUpdateDate(new Date(Calendar.getInstance().getTime().getTime()));

    if (!entity.getChartSql().equals(chartReport.getChartSql())) {
        entity.setChartSql(chartReport.getChartSql());
        Set<Parameter> icNewList = new LinkedHashSet<Parameter>();

        Set<Parameter> oldParameters = entity.getParameters();
        Set<Parameter> newParameters = ChartAnalysisUtil.analysisSql(chartReport.getChartSql());
        for (Parameter newParameter : newParameters) {
            Parameter ic = findListEntity(oldParameters, newParameter);
            if (ic == null) {
                ic = newParameter;
            }
            icNewList.add(ic);
        }
        entity.setParameters(icNewList);
    }
    chartReportDAO.merge(entity);
    return chartReport.getId();
}

From source file:org.jcf.ConnectionImpl.java

/**
 * Connection class for connection to a jabber server
 * @param jabberServer chatserver name/* w w  w.  ja va 2  s.  c om*/
 * @param userName username in chatserver to connect
 * @param passwd password on chatserver
 */
ConnectionImpl(String jabberServer, String userName, String passwd) {
    Assert.hasLength(jabberServer);
    Assert.hasLength(userName);
    Assert.hasLength(passwd);

    this.jabberServer = jabberServer;
    this.userName = userName;
    this.passwd = passwd;

    invitationListener = Collections.synchronizedList(new ArrayList<MUCInvitationListener>());
}

From source file:com.kodgemisi.common.thymeleaf.ThymeleafLayoutInterceptor.java

public void setDefaultLayout(String defaultLayout) {
    Assert.hasLength(defaultLayout);
    this.defaultLayout = defaultLayout;
}

From source file:org.jcf.graphicMessage.GraphicObjectFactory.java

/**
 * creating new PolygonImpl object with new id and a list of locations
 * @param nikName Nikname inside room//from  w  w w.  j  a  v  a 2s.  co  m
 * @param room name of the room
 * @param locs Location instance
 * @return new created PolygonImpl object
 */
public static Polygon createPolygon(String nikName, String room, List<Location> locs) {
    Assert.hasLength(nikName);
    Assert.hasLength(room);
    Assert.notNull(locs);

    Id id = IdFactory.getNextId(room, nikName);
    Polygon p = new PolygonImpl(id);
    p.addAllLocation(locs);
    return p;
}