Tabnine Logo
ArrayUtil.add
Code IndexAdd Tabnine to your IDE (free)

How to use
add
method
in
cc.blynk.utils.ArrayUtil

Best Java code snippets using cc.blynk.utils.ArrayUtil.add (Showing top 8 results out of 315)

origin: blynkkk/blynk-server

public void addTag(DashBoard dash, Tag newTag) {
  dash.tags = ArrayUtil.add(dash.tags, newTag, Tag.class);
}
origin: blynkkk/blynk-server

public void addDevice(DashBoard dash, Device device) {
  dash.devices = ArrayUtil.add(dash.devices, device, Device.class);
}
origin: blynkkk/blynk-server

public static void messageReceived(ChannelHandlerContext ctx, MobileStateHolder state,
                  StringMessage message, int maxWidgetSize) {
  var appString = message.body;
  if (appString == null || appString.isEmpty()) {
    throw new IllegalCommandException("Income app message is empty.");
  }
  if (appString.length() > maxWidgetSize) {
    throw new NotAllowedException("App is larger then limit.", message.id);
  }
  var newApp = JsonParser.parseApp(appString, message.id);
  newApp.id = AppNameUtil.generateAppId();
  if (newApp.isNotValid()) {
    throw new NotAllowedException("App is not valid.", message.id);
  }
  log.debug("Creating new app {}.", newApp);
  var user = state.user;
  if (user.profile.apps.length > 25) {
    throw new NotAllowedException("App limit is reached.", message.id);
  }
  for (App app : user.profile.apps) {
    if (app.id.equals(newApp.id)) {
      throw new NotAllowedException("App with same id already exists.", message.id);
    }
  }
  user.profile.apps = ArrayUtil.add(user.profile.apps, newApp, App.class);
  user.lastModifiedTs = System.currentTimeMillis();
  ctx.writeAndFlush(makeUTF8StringMessage(CREATE_APP, message.id, JsonParser.toJson(newApp)), ctx.voidPromise());
}
origin: blynkkk/blynk-server

user.profile.dashBoards = ArrayUtil.add(user.profile.dashBoards, newDash, DashBoard.class);
origin: blynkkk/blynk-server

user.profile.dashBoards = ArrayUtil.add(user.profile.dashBoards, newDash, DashBoard.class);
origin: blynkkk/blynk-server

deviceTiles.templates = ArrayUtil.add(deviceTiles.templates, newTileTemplate, TileTemplate.class);
deviceTiles.recreateTilesIfNecessary(newTileTemplate, null);
origin: blynkkk/blynk-server

  dash.widgets = ArrayUtil.add(dash.widgets, newWidget, Widget.class);
} else {
  tileTemplate.widgets = ArrayUtil.add(tileTemplate.widgets, newWidget, Widget.class);
origin: blynkkk/blynk-server

reportingWidget.reports = ArrayUtil.add(reportingWidget.reports, report, Report.class);
dash.updatedAt = System.currentTimeMillis();
cc.blynk.utilsArrayUtiladd

Popular methods of ArrayUtil

  • contains
  • copyAndReplace
  • remove
  • deleteFromArray

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JList (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now