text:
<?php

$noforcelogin = 1;
include("cdash/config.php");
require_once("cdash/pdo.php");
include('login.php');
include_once("cdash/common.php");
include("cdash/version.php");

@$buildid = $_GET["buildid"];
// Checks
if(!isset($buildid) || !is_numeric($buildid))
  {
  echo "Not a valid buildid!";
  return;
  }

@$date = $_GET["date"];
$db = pdo_connect("$CDASH_DB_HOST", "$CDASH_DB_LOGIN","$CDASH_DB_PASS");
pdo_select_db("$CDASH_DB_NAME",$db);

$build_array = pdo_fetch_array(pdo_query("SELECT * FROM build WHERE id='$buildid'"));
$projectid = $build_array["projectid"];
if(!isset($projectid) || $projectid==0)
  {
  echo "This build doesn't exist. Maybe it has been deleted.";
  exit();
  }

checkUserPolicy(@$_SESSION['cdash']['loginid'],$projectid);

// Format the text to fit the iPhone
function format_for_iphone($text)
{
  global $FormatTextForIphone;
  if(!isset($FormatTextForIphone))
    {
    return $text;
    }
  $text = str_replace("\n","<br/>",$text);
  return $text;
}

$xml = begin_XML_for_XSLT();
$projectname = get_project_name($projectid);
$xml .= "<title>CDash : ".$projectname."</title>";

// Find the last submit date
$siteid = $build_array["siteid"];
$buildtype = $build_array["type"];
$buildname = $build_array["name"];
$starttime = $build_array["starttime"];
$previousbuild = pdo_query("SELECT id,starttime FROM build
                            WHERE siteid='$siteid' AND type='$buildtype' AND name='$buildname'
                             AND projectid='$projectid' AND starttime<'$starttime' ORDER BY starttime DESC LIMIT 1");

if(pdo_num_rows($previousbuild)>0)
  {
  $previousbuild_array = pdo_fetch_array($previousbuild);
  $lastsubmitbuild = $previousbuild_array["id"];
  $lastsubmitdate = date(FMT_DATETIMETZ,strtotime($previousbuild_array["starttime"]." UTC"));
  }
else
  {
  $lastsubmitbuild = 0;
  $lastsubmitdate = 0;
  }

$xml .= "<menu>";
$nightlytime = get_project_property($projectname,"nightlytime");
$xml .= add_XML_value("back","index.php?project=".urlencode($projectname)."&date=".get_dashboard_date_from_build_starttime($build_array["starttime"],$nightlytime));
if(isset($previousbuild_array))
  {
  $xml .= add_XML_value("previous","buildSummary.php?buildid=".$previousbuild_array["id"]);
  }
else
  {
  $xml .= add_XML_value("noprevious","1");
  }

$xml .= add_XML_value("current","buildSummary.php?buildid=".get_last_buildid($projectid,$siteid,$buildtype,$buildname,$starttime));
$nextbuildid = get_next_buildid($projectid,$siteid,$buildtype,$buildname,$starttime);
if($nextbuildid>0)
  {
  $xml .= add_XML_value("next","buildSummary.php?buildid=".$nextbuildid);
  }
else
  {
  $xml .= add_XML_value("nonext","1");
  }
$xml .= "</menu>";

$xml .= get_cdash_dashboard_xml($projectname,$date);

// User
if(isset($_SESSION['cdash']) && isset($_SESSION['cdash']['loginid']))
  {
  $xml .= "<user>";
  $userid = $_SESSION['cdash']['loginid'];
  $user = pdo_query("SELECT admin FROM ".qid("user")." WHERE id='$userid'");
  $user_array = pdo_fetch_array($user);
  $xml .= add_XML_value("id",$userid);
  $xml .= add_XML_value("admin",$user_array["admin"]);
  $xml .= "</user>";
  }

  // Notes
  $note = pdo_query("SELECT * FROM buildnote WHERE buildid='$buildid' ORDER BY timestamp ASC");
  while($note_array = pdo_fetch_array($note))
    {
    $xml .= "<note>";
    $userid = $note_array["userid"];
    $user_array = pdo_fetch_array(pdo_query("SELECT firstname,lastname FROM ".qid("user")." WHERE id='$userid'"));
    $timestamp = strtotime($note_array["timestamp"]." UTC");
    $usernote = $user_array["firstname"]." ".$user_array["lastname"];
    switch($note_array["status"])
      {
      case 0: $status = "[note]"; break;
      case 1: $status = "[fix in progress]"; break;
      case 2: $status = "[fixed]"; break;
      }
    $xml .= add_XML_value("status",$status);
    $xml .= add_XML_value("user",$usernote);
    $xml .= add_XML_value("date",date("H:i:s T",$timestamp));
    $xml .= add_XML_value("text",$note_array["note"]);
    $xml .= "</note>";
    }

  // Build
  $xml .= "<build>";
  $build = pdo_query("SELECT * FROM build WHERE id='$buildid'");
  $build_array = pdo_fetch_array($build);
  $site_array = pdo_fetch_array(pdo_query("SELECT name FROM site WHERE id='$siteid'"));
  $xml .= add_XML_value("site",$site_array["name"]);
  $xml .= add_XML_value("sitename_encoded",urlencode($site_array["name"]));
  $xml .= add_XML_value("siteid",$siteid);
  $xml .= add_XML_value("name",$build_array["name"]);
  $xml .= add_XML_value("id",$build_array["id"]);
  $xml .= add_XML_value("stamp",$build_array["stamp"]);
  $xml .= add_XML_value("time",date(FMT_DATETIMETZ,strtotime($build_array["starttime"]." UTC")));
  $xml .= add_XML_value("type",$build_array["type"]);

  $note = pdo_query("SELECT count(buildid) AS c FROM build2note WHERE buildid='$buildid'");
  $note_array = pdo_fetch_array($note);
  $xml .= add_XML_value("note",$note_array["c"]);

  // Compute a related builds link. Most useful in projects with sub-projects
  // defined, but maybe still useful for monolithic projects. Displays all
  // builds (using filters) that share the same build name, site name *and*
  // build stamp. (Other "related" links that might be useful: all with same
  // (or similar?) build name, all with same site name, all with same stamp.)
  //
  $filterString =
    "&filtercount=3&showfilters=1&filtercombine=and" .
    "&field1=buildname/string&compare1=61&value1=" .
      urlencode($build_array["name"]) .
    "&field2=site/string&compare2=61&value2=" .
      urlencode($site_array["name"]) .
    "&field3=buildstamp/string&compare3=61&value3=" .
      urlencode($build_array["stamp"]);

  $relatedBuildsLink = "index.php?project=" . urlencode($projectname) .
    "&display=project" . $filterString;

  $xml .= add_XML_value("relatedBuildsLink", $relatedBuildsLink);

  // For the filter (we display 1 week)
  $xml .= add_XML_value("filterstarttime",date("Y-m-d",strtotime($build_array["starttime"]." UTC -7 days")));
  $xml .= add_XML_value("filterendtime",date("Y-m-d",strtotime($build_array["starttime"]." UTC")));

  // Find the OS and compiler information
  $buildinformation = pdo_query("SELECT * FROM buildinformation WHERE buildid='$buildid'");
  if(pdo_num_rows($buildinformation)>0)
    {
    $buildinformation_array = pdo_fetch_array($buildinformation);
    if($buildinformation_array["osname"]!="")
      {
      $xml .= add_XML_value("osname",$buildinformation_array["osname"]);
      }
    if($buildinformation_array["osplatform"]!="")
      {
      $xml .= add_XML_value("osplatform",$buildinformation_array["osplatform"]);
      }
    if($buildinformation_array["osrelease"]!="")
      {
      $xml .= add_XML_value("osrelease",$buildinformation_array["osrelease"]);
      }
    if($buildinformation_array["osversion"]!="")
      {
      $xml .= add_XML_value("osversion",$buildinformation_array["osversion"]);
      }
    if($buildinformation_array["compilername"]!="")
      {
      $xml .= add_XML_value("compilername",$buildinformation_array["compilername"]);
      }
    if($buildinformation_array["compilerversion"]!="")
      {
      $xml .= add_XML_value("compilerversion",$buildinformation_array["compilerversion"]);
      }
    }

  $xml .= add_XML_value("generator",$build_array["generator"]);
  $xml .= add_XML_value("command",$build_array["command"]);
  $xml .= add_XML_value("starttime",date(FMT_DATETIMETZ,strtotime($build_array["starttime"]." UTC")));
  $xml .= add_XML_value("endtime",date(FMT_DATETIMETZ,strtotime($build_array["endtime"]." UTC")));

  $xml .= add_XML_value("lastsubmitdate",$lastsubmitdate);

  // Number of errors and warnings
  $builderror = pdo_query("SELECT count(*) FROM builderror WHERE buildid='$buildid' AND type='0'");
  $builderror_array = pdo_fetch_array($builderror);
  $nerrors = $builderror_array[0];
  $builderror = pdo_query("SELECT count(*) FROM buildfailure WHERE buildid='$buildid' AND type='0'");
  $builderror_array = pdo_fetch_array($builderror);
  $nerrors += $builderror_array[0];

  $xml .= add_XML_value("error",$nerrors);
  $buildwarning = pdo_query("SELECT count(*) FROM builderror WHERE buildid='$buildid' AND type='1'");
  $buildwarning_array = pdo_fetch_array($buildwarning);
  $nwarnings = $buildwarning_array[0];
  $buildwarning = pdo_query("SELECT count(*) FROM buildfailure WHERE buildid='$buildid' AND type='1'");
  $buildwarning_array = pdo_fetch_array($buildwarning);
  $nwarnings += $buildwarning_array[0];

  $xml .= add_XML_value("nerrors",$nerrors);
  $xml .= add_XML_value("nwarnings",$nwarnings);

  // Display the build errors
  $errors = pdo_query("SELECT * FROM builderror WHERE buildid='$buildid' and type='0'");
  while($error_array = pdo_fetch_array($errors))
    {
    $xml .= "<error>";
    $xml .= add_XML_value("logline",$error_array["logline"]);
    $xml .= add_XML_value("text",format_for_iphone($error_array["text"]));
    $xml .= add_XML_value("sourcefile",$error_array["sourcefile"]);
    $xml .= add_XML_value("sourceline",$error_array["sourceline"]);
    $xml .= add_XML_value("precontext",format_for_iphone($error_array["precontext"]));
    $xml .= add_XML_value("postcontext",format_for_iphone($error_array["postcontext"]));
    $xml .= "</error>";
    }

  // Display the build failure error
  $errors = pdo_query("SELECT sourcefile,stdoutput,stderror FROM buildfailure WHERE buildid='$buildid' and type='0'");
  while($error_array = pdo_fetch_array($errors))
    {
    $xml .= "<error>";
    $xml .= add_XML_value("sourcefile",$error_array["sourcefile"]);
    $xml .= add_XML_value("stdoutput",format_for_iphone($error_array["stdoutput"]));
    $xml .= add_XML_value("stderror",$error_array["stderror"]);
    $xml .= "</error>";
    }

  // Display the warnings
  $errors = pdo_query("SELECT * FROM builderror WHERE buildid='$buildid' and type='1'");
  while($error_array = pdo_fetch_array($errors))
    {
    $xml .= "<warning>";
    $xml .= add_XML_value("logline",$error_array["logline"]);
    $xml .= add_XML_value("text",format_for_iphone($error_array["text"]));
    $xml .= add_XML_value("sourcefile",$error_array["sourcefile"]);
    $xml .= add_XML_value("sourceline",$error_array["sourceline"]);
    $xml .= add_XML_value("precontext",format_for_iphone($error_array["precontext"]));
    $xml .= add_XML_value("postcontext",format_for_iphone($error_array["postcontext"]));
    $xml .= "</warning>";
    }

  // Display the build failure error
  $errors = pdo_query("SELECT sourcefile,stdoutput,stderror FROM buildfailure WHERE buildid='$buildid' and type='1'");
  while($error_array = pdo_fetch_array($errors))
    {
    $xml .= "<warning>";
    $xml .= add_XML_value("sourcefile",$error_array["sourcefile"]);
    $xml .= add_XML_value("stdoutput",format_for_iphone($error_array["stdoutput"]));
    $xml .= add_XML_value("stderror",$error_array["stderror"]);
    $xml .= "</warning>";
    }

  $xml .= "</build>";

  // Update
  $buildupdate = pdo_query("SELECT * FROM buildupdate AS u ,build2update AS b2u WHERE b2u.updateid=u.id AND b2u.buildid=".qnum($buildid));

  if(pdo_num_rows($buildupdate)>0) // show the update only if we have one
    {
    $xml .= "<update>";
    $update_array = pdo_fetch_array($buildupdate);
    // Checking for locally modify files
    $updatelocal = pdo_query("SELECT updatefile.updateid FROM updatefile,build2update AS b2u WHERE updatefile.updateid=b2u.updateid AND b2u.buildid=".qnum($buildid)
      ." AND author='Local User'");
    $nerrors = pdo_num_rows($updatelocal);

    // Check also if the status is not zero
    if(strlen($update_array["status"]) > 0 && $update_array["status"]!="0")
      {
      $nerrors += 1;
      $xml .= add_XML_value("status",$update_array["status"]);
      }
    $nwarnings = 0;
    $xml .= add_XML_value("nerrors",$nerrors);
    $xml .= add_XML_value("nwarnings",$nwarnings);

    $update = pdo_query("SELECT updatefile.updateid FROM updatefile,build2update AS b2u WHERE updatefile.updateid=b2u.updateid AND b2u.buildid=".qnum($buildid));
    $nupdates = pdo_num_rows($update);
    $xml .= add_XML_value("nupdates",$nupdates);

    $xml .= add_XML_value("command",$update_array["command"]);
    $xml .= add_XML_value("type",$update_array["type"]);
    $xml .= add_XML_value("starttime",date(FMT_DATETIMETZ,strtotime($update_array["starttime"]." UTC")));
    $xml .= add_XML_value("endtime",date(FMT_DATETIMETZ,strtotime($update_array["endtime"]." UTC")));
    $xml .= "</update>";
    }

  // Configure
  $xml .= "<configure>";
  $configure = pdo_query("SELECT * FROM configure WHERE buildid='$buildid'");
  $configure_array = pdo_fetch_array($configure);

  $nerrors = 0;
  if($configure_array["status"]!=0)
    {
    $nerrors = 1;
    }

  $xml .= add_XML_value("nerrors",$nerrors);
  $xml .= add_XML_value("nwarnings",$configure_array['warnings']);

  $xml .= add_XML_value("status",$configure_array["status"]);
  $xml .= add_XML_value("command",$configure_array["command"]);
  $xml .= add_XML_value("output",format_for_iphone($configure_array["log"]));
  $xml .= add_XML_value("starttime",date(FMT_DATETIMETZ,strtotime($configure_array["starttime"]." UTC")));
  $xml .= add_XML_value("endtime",date(FMT_DATETIMETZ,strtotime($configure_array["endtime"]." UTC")));
  $xml .= "</configure>";

  // Test
  $xml .= "<test>";
  $nerrors = 0;
  $nwarnings = 0;
  $xml .= add_XML_value("nerrors",$nerrors);
  $xml .= add_XML_value("nwarnings",$nwarnings);

  $npass_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='$buildid' AND status='passed'"));
  $npass = $npass_array[0];
  $nnotrun_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='$buildid' AND status='notrun'"));
  $nnotrun = $nnotrun_array[0];
  $nfail_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='$buildid' AND status='failed'"));
  $nfail = $nfail_array[0];

  $xml .= add_XML_value("npassed",$npass);
  $xml .= add_XML_value("nnotrun",$nnotrun);
  $xml .= add_XML_value("nfailed",$nfail);

  $xml .= "</test>";

  // Coverage
  $coverage_array = pdo_fetch_array(pdo_query("SELECT * FROM coveragesummary WHERE buildid='$buildid'"));
  if ($coverage_array)
    {
    $coverage_percent = round($coverage_array["loctested"] /
      ($coverage_array["loctested"]+$coverage_array["locuntested"]) * 100, 2);
    $xml .= add_XML_value("coverage", $coverage_percent);
    }

  // Previous build
  // Find the previous build
  if($lastsubmitbuild > 0)
    {
    $xml .= "<previousbuild>";
    $previousbuildid = $lastsubmitbuild;
    $xml .= add_XML_value("buildid",$previousbuildid);

    // Find if the build has any errors
    $builderror = pdo_query("SELECT count(*) FROM builderror WHERE buildid='$previousbuildid' AND type='0'");
    $builderror_array = pdo_fetch_array($builderror);
    $npreviousbuilderrors = $builderror_array[0];
    $builderror = pdo_query("SELECT count(*) FROM buildfailure WHERE buildid='$previousbuildid' AND type='0'");
    $builderror_array = pdo_fetch_array($builderror);
    $npreviousbuilderrors += $builderror_array[0];

    // Find if the build has any warnings
    $buildwarning = pdo_query("SELECT count(*) FROM builderror WHERE buildid='$previousbuildid' AND type='1'");
    $buildwarning_array = pdo_fetch_array($buildwarning);
    $npreviousbuildwarnings = $buildwarning_array[0];
    $buildwarning = pdo_query("SELECT count(*) FROM buildfailure WHERE buildid='$previousbuildid' AND type='1'");
    $buildwarning_array = pdo_fetch_array($buildwarning);
    $npreviousbuildwarnings += $buildwarning_array[0];

    // Find if the build has any test failings
    $nfail_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='$previousbuildid' AND status='failed'"));
    $npreviousfailingtests = $nfail_array[0];
    $nfail_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='$previousbuildid' AND status='notrun'"));
    $npreviousnotruntests = $nfail_array[0];

    $updatelocal = pdo_query("SELECT updatefile.updateid FROM updatefile,build2update AS b2u WHERE updatefile.updateid=b2u.updateid AND b2u.buildid=".qnum($previousbuildid).
      " AND author='Local User'");
    $nupdateerrors = pdo_num_rows($updatelocal);
    $nupdatewarnings = 0;
    $xml .= add_XML_value("nupdateerrors",$nupdateerrors);
    $xml .= add_XML_value("nupdatewarnings",$nupdatewarnings);

    $configure = pdo_query("SELECT * FROM configure WHERE buildid='$previousbuildid'");
    $configure_array = pdo_fetch_array($configure);

    $nconfigureerrors = 0;
    if($configure_array["status"]!=0)
      {
      $nconfigureerrors = 1;
      }
    $xml .= add_XML_value("nconfigureerrors",$nconfigureerrors);
    $xml .= add_XML_value("nconfigurewarnings",$configure_array['warnings']);

    $xml .= add_XML_value("nerrors",$npreviousbuilderrors);
    $xml .= add_XML_value("nwarnings",$npreviousbuildwarnings);

    $xml .= add_XML_value("ntestfailed",$npreviousfailingtests);
    $xml .= add_XML_value("ntestnotrun",$npreviousnotruntests);

    $xml .= "</previousbuild>";
    }
  $xml .= "</cdash>";

// Now doing the xslt transition
if(!isset($NoXSLGenerate))
  {
  generate_XSLT($xml,"buildSummary");
  }
?>


text:
package org.apache.tamaya.core.internal.converters;

import org.apache.tamaya.spi.PropertyConverter;

import java.time.LocalDateTime;
import java.util.Objects;

/**
 * Converter, converting from String to LocalDateTime.
 */
public class LocalDateTimeConverter implements PropertyConverter<LocalDateTime>{

    @Override
    public LocalDateTime convert(String value) {
        String trimmed = Objects.requireNonNull(value).trim();
        return LocalDateTime.parse(trimmed);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" />
<title>

  InjectorBuilder

| Guice

</title>
<link href="../../../../javadoc/assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../../../../javadoc/assets/customizations.css" rel="stylesheet" type="text/css" />

      Guice

          <form accept-charset="utf-8" class="gsc-search-box"
                onsubmit="return submit_search()">

                    <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
                      title="search developer docs" name="q"
                      value="search developer docs"
                      onFocus="search_focus_changed(this, true)"
                      onBlur="search_focus_changed(this, false)"
                      onkeydown="return search_changed(event, true, '../../../')"
                      onkeyup="return search_changed(event, false, '../../../')" />

                    <input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />

          </form>

    <input type="checkbox" id="apiLevelCheckbox" onclick="toggleApiLevelSelector(this)" />
    Filter by API Level:
    <select id="apiLevelSelector">

    </select>

<nobr>
                Package Index |
                Class Index</nobr>

  com.google.inject

  com.google.inject.assistedinject

  com.google.inject.binder

  com.google.inject.jndi

  com.google.inject.matcher

  com.google.inject.multibindings

  com.google.inject.name

  com.google.inject.persist

  com.google.inject.persist.finder

  com.google.inject.persist.jpa

  com.google.inject.servlet

  com.google.inject.spi

  com.google.inject.spring

  com.google.inject.throwingproviders

  com.google.inject.tools.jmx

  com.google.inject.util

Interfaces

Binder

Binding<T>

Injector

MembersInjector<T>

Module

PrivateBinder

Provider<T>

Scope

Classes

AbstractModule

Guice

InjectorBuilder

Key<T>

PrivateModule

Scopes

TypeLiteral<T>

Annotations

BindingAnnotation

Exposed

ImplementedBy

Inject

ProvidedBy

Provides

ScopeAnnotation

Singleton

Enums

Stage

Exceptions

ConfigurationException

CreationException

OutOfScopeException

ProvisionException

<nobr>
            Package Index |
            Class Index</nobr>

Summary:

  Ctors

  | Methods

  | Inherited Methods

| [Expand All]

  Since: API Level Guice_3.0

    public

    final

    class

InjectorBuilder

    extends Object

        java.lang.Object

               ↳

        com.google.inject.InjectorBuilder

Class Overview

The advanced entry point to the Guice framework. Creates Injectors from
 Modules, allowing many options to be configured for the Injector.

Guice supports a model of development that draws clear boundaries between
 APIs, Implementations of these APIs, Modules which configure these
 implementations, and finally Applications which consist of a collection of
 Modules. It is the Application, which typically defines your main()
 method, that bootstraps the Guice Injector using the Guice class, as
 in this example:

     public class FooApplication {
       public static void main(String[] args) {
         Injector injector = new InjectorBuilder().
             .stage(Stage.PRODUCTION)
             . . .
             .addModules(
                new ModuleA(),
                new ModuleB(),
                . . .
                new FooApplicationFlagsModule(args)
             )
             .build();
         );

         // Now just bootstrap the application and you're done
         FooStarter starter = injector.getInstance(FooStarter.class);
         starter.runApplication();
       }
     }

Summary

Public Constructors

        <nobr>

            </nobr>

        <nobr>
        InjectorBuilder()</nobr>

Public Methods

        <nobr>

            InjectorBuilder</nobr>

        <nobr>
        addModules(Module... modules)</nobr>

Adds more modules that will be used when the Injector is created.

        <nobr>

            InjectorBuilder</nobr>

        <nobr>
        <a href="../../../com/google/inject/InjectorBuilder.html#addModules(java.lang.Iterable<? extends com.google.inject.Module>)">addModules(Iterable<? extends Module> modules)</nobr>

Adds more modules that will be used when the Injector is created.

        <nobr>

            Injector</nobr>

        <nobr>
        build()</nobr>

Builds the injector.

        <nobr>

            InjectorBuilder</nobr>

        <nobr>
        disableCircularProxies()</nobr>

Prevents Guice from constructing a Proxy when a circular dependency
 is found.

        <nobr>

            InjectorBuilder</nobr>

        <nobr>
        requireExplicitBindings()</nobr>

If explicit bindings are required, then classes that are not explicitly
 bound in a module cannot be injected.

        <nobr>

            InjectorBuilder</nobr>

        <nobr>
        stage(Stage stage)</nobr>

Sets the stage for the injector.

  [Expand]

Inherited Methods

From class

  java.lang.Object

        <nobr>

            Object</nobr>

        <nobr>
        clone()</nobr>

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object arg0)</nobr>

        <nobr>

            void</nobr>

        <nobr>
        finalize()</nobr>

        <nobr>

            final

            Class<?></nobr>

        <nobr>
        getClass()</nobr>

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        notify()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        notifyAll()</nobr>

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long arg0)</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long arg0, int arg1)</nobr>

Public Constructors

        public

      InjectorBuilder
      ()

  Since: API Level Guice_3.0

Public Methods

        public

        InjectorBuilder

      addModules
      (Module... modules)

  Since: API Level Guice_3.0

Adds more modules that will be used when the Injector is created.

<A NAME="addModules(java.lang.Iterable<? extends com.google.inject.Module>)">

        public

        InjectorBuilder

      addModules
      (Iterable<? extends Module> modules)

  Since: API Level Guice_3.0

Adds more modules that will be used when the Injector is created.

        public

        Injector

      build
      ()

  Since: API Level Guice_3.0

Builds the injector.

        public

        InjectorBuilder

      disableCircularProxies
      ()

  Since: API Level Guice_3.0

Prevents Guice from constructing a Proxy when a circular dependency
 is found.

        public

        InjectorBuilder

      requireExplicitBindings
      ()

  Since: API Level Guice_3.0

If explicit bindings are required, then classes that are not explicitly
 bound in a module cannot be injected. Bindings created through a linked
 binding (bind(Foo.class).to(FooImpl.class)) are allowed, but
 the implicit binding (FooImpl) cannot be directly injected unless it is
 also explicitly bound.

 Tools can still retrieve bindings for implicit bindings (bindings created
 through a linked binding) if explicit bindings are required, however
 getProvider() cannot be used.

 By default, explicit bindings are not required.

        public

        InjectorBuilder

      stage
      (Stage stage)

  Since: API Level Guice_3.0

Sets the stage for the injector. If the stage is PRODUCTION,
 singletons will be eagerly loaded when the Injector is built.

Generated by Doclava.


text:
package com.carporange.cloudmusic.util;

import com.google.gson.Gson;

import java.lang.reflect.Type;
import java.util.List;

/**
 * Created by liuhui on 2016/6/19.
 */
public class GsonUtil {
    /**
     * @param json json字符串
     * @param clazz
     * @param <T>
     * @return
     * @brief 将JSON转为实体
     */
    public static <T> T json2Bean(String json, Class<T> clazz) {

        Gson gson = new Gson();
        try {
            T t = gson.fromJson(json, clazz);
            return t;
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("GSON EX ++++++++++++" + e.toString());
            return null;
        }
    }

    /**
     * @param obj
     * @return
     * @brief 将一个对象装为Json格式的字符串
     */
    public static String bean2json(Object obj) {
        Gson gson = new Gson();
        return gson.toJson(obj);
    }

    /**
     * 把json字符串解析成集合
     * params: new TypeToken<List<AppInfo>>(){}.getType(),
     *
     * @param json
     * @param type new TypeToken<List<yourbean>>(){}.getType()
     * @return
     */
    public static List<?> parseJsonToList(String json, Type type) {
        Gson gson = new Gson();
        List<?> list = gson.fromJson(json, type);
        return list;
    }
}


text:
'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _enzyme = require('enzyme');

var _chai = require('chai');

var _sinon = require('sinon');

var _Chip = require('./Chip');

var _Chip2 = _interopRequireDefault(_Chip);

var _getMuiTheme = require('../styles/getMuiTheme');

var _getMuiTheme2 = _interopRequireDefault(_getMuiTheme);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/* eslint-env mocha */
var Avatar = function Avatar(props) {
  return _react2.default.createElement('div', props);
};
Avatar.muiName = 'Avatar';

describe('<Chip />', function () {
  var muiTheme = (0, _getMuiTheme2.default)();
  var themedShallow = function themedShallow(node) {
    var context = { muiTheme: muiTheme };
    return (0, _enzyme.shallow)(node, { context: context });
  };

  describe('state', function () {
    var wrapper = themedShallow(_react2.default.createElement(
      _Chip2.default,
      { onTouchTap: function onTouchTap() {} },
      'Label'
    ));

    it('renders with initial state of false for clicked and focused', function () {
      _chai.assert.strictEqual(wrapper.state('clicked'), false);
      _chai.assert.strictEqual(wrapper.state('focused'), false);
    });

    it('sets the focus state onFocus', function () {
      wrapper.simulate('focus');
      _chai.assert.strictEqual(wrapper.state('focused'), true);
    });

    it('sets the clicked state on mouseDown', function () {
      wrapper.simulate('mouseDown', {
        stopPropagation: function stopPropagation() {},
        button: 0 });
      _chai.assert.strictEqual(wrapper.state('clicked'), true);
    });

    it('unsets the clicked state on mouseUp', function () {
      wrapper.simulate('mouseUp');
      _chai.assert.strictEqual(wrapper.state('clicked'), false);
    });

    it('sets the clicked state on touchStart', function () {
      wrapper.simulate('touchStart', {
        stopPropagation: function stopPropagation() {}
      });
      _chai.assert.strictEqual(wrapper.state('clicked'), true);
    });

    it('unsets the clicked state on touchEnd', function () {
      wrapper.simulate('touchEnd');
      _chai.assert.strictEqual(wrapper.state('clicked'), false);
    });

    it('resets the state on blur', function () {
      wrapper.setState({ focused: true, clicked: true });
      wrapper.simulate('blur');
      _chai.assert.strictEqual(wrapper.state('clicked'), false);
      _chai.assert.strictEqual(wrapper.state('focused'), false);
    });
  });

  describe('rendering', function () {
    it('renders an EnhancedButton', function () {
      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        null,
        'Label'
      ));
      _chai.assert.ok(wrapper.is('EnhancedButton'));
    });

    it('renders children', function () {
      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        null,
        'Hello world'
      ));
      _chai.assert.ok(wrapper.contains('Hello world'), 'should contain the children');
    });

    it('merges styles and other props into the root node', function () {
      var wrapper = themedShallow(_react2.default.createElement(_Chip2.default, {
        style: { paddingRight: 200, color: 'purple', border: '1px solid tomato' },
        myProp: 'hello'
      }));

      var _wrapper$props = wrapper.props(),
          style = _wrapper$props.style,
          myProp = _wrapper$props.myProp;

      _chai.assert.strictEqual(style.paddingRight, 200);
      _chai.assert.strictEqual(style.color, 'purple');
      _chai.assert.strictEqual(style.border, '1px solid tomato');
      _chai.assert.strictEqual(myProp, 'hello');
    });

    it('renders a label with an Avatar before', function () {
      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        null,
        _react2.default.createElement(Avatar, { src: 'images/kolage-128.jpg' }),
        'Hello World'
      ));
      var avatar = wrapper.children().at(0);
      var label = wrapper.children().at(1);
      _chai.assert.ok(avatar.is('Avatar'));
      _chai.assert.ok(label.is('span'));
      _chai.assert.strictEqual(label.children().node, 'Hello World', 'says hello world');
    });

    it('does not render a delete icon by default', function () {
      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        null,
        'Label'
      ));
      _chai.assert.notOk(wrapper.find('NavigationCancel').length);
    });

    it('renders a delete icon after the label when onRequestDelete is provided', function () {
      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        { onRequestDelete: (0, _sinon.spy)() },
        'Label'
      ));
      _chai.assert.ok(wrapper.childAt(1).is('NavigationCancel'));
    });
  });

  describe('callbacks', function () {
    it('triggers onRequestDelete when the delete icon is clicked', function () {
      var handleRequestDelete = (0, _sinon.spy)();
      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        { onRequestDelete: handleRequestDelete },
        'Label'
      ));
      wrapper.childAt(1).simulate('touchTap', {
        stopPropagation: function stopPropagation() {}
      });
      _chai.assert.ok(handleRequestDelete.calledOnce);
    });

    it('bubbles callbacks used internally', function () {
      var events = ['blur', 'focus', 'keyDown', 'keyboardFocus', 'mouseDown', 'mouseEnter', 'mouseUp', 'touchEnd', 'touchStart'];

      var handlers = {};
      var props = {};

      events.forEach(function (event) {
        handlers[event] = (0, _sinon.spy)();
        props['on' + (event.charAt(0).toUpperCase() + event.slice(1))] = handlers[event];
      });

      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        props,
        'Step One'
      ));

      events.forEach(function (event) {
        wrapper.simulate(event, {
          stopPropagation: function stopPropagation() {}
        });
        _chai.assert.ok(handlers[event].calledOnce, 'should trigger the ' + event + ' callback');
      });
    });
  });

  describe('prop: containerElement', function () {
    it('should use div if no containerElement specified', function () {
      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        null,
        'Label'
      ));
      var button = wrapper.dive({ context: { muiTheme: muiTheme } });
      _chai.assert.strictEqual(button.is('div'), true, 'should match an div element');
    });

    it('should use the given string containerElement prop', function () {
      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        { containerElement: 'span' },
        'Label'
      ));
      var button = wrapper.dive({ context: { muiTheme: muiTheme } });
      _chai.assert.strictEqual(button.is('span'), true, 'should match an span element');
    });

    it('should use the given ReactElement containerElement prop', function () {
      var CustomElement = function CustomElement(props) {
        return _react2.default.createElement('a', props);
      };
      var wrapper = themedShallow(_react2.default.createElement(
        _Chip2.default,
        { containerElement: _react2.default.createElement(CustomElement, null) },
        'Label'
      ));
      var button = wrapper.dive({ context: { muiTheme: muiTheme } });
      _chai.assert.strictEqual(button.is(CustomElement), true, 'should match the custom element');
    });
  });
});


text:
<?php

namespace Doctrine\ODM\MongoDB\Mapping\Annotations;

/**
 * @Annotation
 * @deprecated This class will be removed in ODM 2.0. Use `@ODM\Field(type="integer")` instead.
 */
final class Integer extends AbstractField
{
    public $type = 'integer';

    public function isDeprecated()
    {
        return true;
    }
}


text:
using System.Collections.Generic;
using FluentMigrator.Builders;
using FluentMigrator.Builders.Delete.ForeignKey;
using FluentMigrator.Expressions;
using FluentMigrator.Model;
using Moq;
using NUnit.Framework;

namespace FluentMigrator.Tests.Unit.Builders.Delete
{
    [TestFixture]
    public class DeleteForeignKeyExpressionBuilderTests
    {
        [Test]
        public void CallingFromTableSetsForeignTableName()
        {
            var foreignKeyMock = new Mock<ForeignKeyDefinition>();

            var expressionMock = new Mock<DeleteForeignKeyExpression>();
            expressionMock.SetupGet(e => e.ForeignKey).Returns(foreignKeyMock.Object);

            var builder = new DeleteForeignKeyExpressionBuilder(expressionMock.Object);
            builder.FromTable("Bacon");

            foreignKeyMock.VerifySet(f => f.ForeignTable = "Bacon");
            expressionMock.VerifyGet(e => e.ForeignKey);
        }

        [Test]
        public void CallingToTableSetsPrimaryTableName()
        {
            var foreignKeyMock = new Mock<ForeignKeyDefinition>();

            var expressionMock = new Mock<DeleteForeignKeyExpression>();
            expressionMock.SetupGet(e => e.ForeignKey).Returns(foreignKeyMock.Object);

            var builder = new DeleteForeignKeyExpressionBuilder(expressionMock.Object);
            builder.ToTable("Bacon");

            foreignKeyMock.VerifySet(f => f.PrimaryTable = "Bacon");
            expressionMock.VerifyGet(e => e.ForeignKey);
        }

        [Test]
        public void CallingOnTableSetsForeignTableName()
        {
            var foreignKeyMock = new Mock<ForeignKeyDefinition>();

            var expressionMock = new Mock<DeleteForeignKeyExpression>();
            expressionMock.SetupGet(e => e.ForeignKey).Returns(foreignKeyMock.Object);

            var builder = new DeleteForeignKeyExpressionBuilder(expressionMock.Object);
            ((IDeleteForeignKeyOnTableSyntax)builder).OnTable(("Bacon"));

            foreignKeyMock.VerifySet(f => f.ForeignTable = "Bacon");
            expressionMock.VerifyGet(e => e.ForeignKey);
        }

        [Test]
        public void CallingInSchemaSetsForeignTableSchemaName()
        {
            var foreignKeyMock = new Mock<ForeignKeyDefinition>();

            var expressionMock = new Mock<DeleteForeignKeyExpression>();
            expressionMock.SetupGet(e => e.ForeignKey).Returns(foreignKeyMock.Object);

            var builder = new DeleteForeignKeyExpressionBuilder(expressionMock.Object);
            ((IInSchemaSyntax)builder).InSchema("Bacon");

            foreignKeyMock.VerifySet(f => f.ForeignTableSchema = "Bacon");
            expressionMock.VerifyGet(e => e.ForeignKey);
        }

        [Test]
        public void CallingForeignColumnAddsColumnNameToForeignColumnCollection()
        {
            var collectionMock = new Mock<IList<string>>();

            var foreignKeyMock = new Mock<ForeignKeyDefinition>();
            foreignKeyMock.SetupGet(f => f.ForeignColumns).Returns(collectionMock.Object);

            var expressionMock = new Mock<DeleteForeignKeyExpression>();
            expressionMock.SetupGet(e => e.ForeignKey).Returns(foreignKeyMock.Object);

            var builder = new DeleteForeignKeyExpressionBuilder(expressionMock.Object);
            builder.ForeignColumn("BaconId");

            collectionMock.Verify(x => x.Add("BaconId"));
            foreignKeyMock.VerifyGet(f => f.ForeignColumns);
            expressionMock.VerifyGet(e => e.ForeignKey);
        }

        [Test]
        public void CallingForeignColumnsAddsColumnNamesToForeignColumnCollection()
        {
            var collectionMock = new Mock<IList<string>>();

            var foreignKeyMock = new Mock<ForeignKeyDefinition>();
            foreignKeyMock.SetupGet(f => f.ForeignColumns).Returns(collectionMock.Object);

            var expressionMock = new Mock<DeleteForeignKeyExpression>();
            expressionMock.SetupGet(e => e.ForeignKey).Returns(foreignKeyMock.Object);

            var builder = new DeleteForeignKeyExpressionBuilder(expressionMock.Object);
            builder.ForeignColumns("BaconId", "EggsId");

            collectionMock.Verify(x => x.Add("BaconId"));
            collectionMock.Verify(x => x.Add("EggsId"));
            foreignKeyMock.VerifyGet(f => f.ForeignColumns);
            expressionMock.VerifyGet(e => e.ForeignKey);
        }

        [Test]
        public void CallingPrimaryColumnAddsColumnNameToPrimaryColumnCollection()
        {
            var collectionMock = new Mock<IList<string>>();

            var foreignKeyMock = new Mock<ForeignKeyDefinition>();
            foreignKeyMock.SetupGet(f => f.PrimaryColumns).Returns(collectionMock.Object);

            var expressionMock = new Mock<DeleteForeignKeyExpression>();
            expressionMock.SetupGet(e => e.ForeignKey).Returns(foreignKeyMock.Object);

            var builder = new DeleteForeignKeyExpressionBuilder(expressionMock.Object);
            builder.PrimaryColumn("BaconId");

            collectionMock.Verify(x => x.Add("BaconId"));
            foreignKeyMock.VerifyGet(f => f.PrimaryColumns);
            expressionMock.VerifyGet(e => e.ForeignKey);
        }

        [Test]
        public void CallingPrimaryColumnsAddsColumnNamesToForeignColumnCollection()
        {
            var collectionMock = new Mock<IList<string>>();

            var foreignKeyMock = new Mock<ForeignKeyDefinition>();
            foreignKeyMock.SetupGet(f => f.PrimaryColumns).Returns(collectionMock.Object);

            var expressionMock = new Mock<DeleteForeignKeyExpression>();
            expressionMock.SetupGet(e => e.ForeignKey).Returns(foreignKeyMock.Object);

            var builder = new DeleteForeignKeyExpressionBuilder(expressionMock.Object);
            builder.PrimaryColumns("BaconId", "EggsId");

            collectionMock.Verify(x => x.Add("BaconId"));
            collectionMock.Verify(x => x.Add("EggsId"));
            foreignKeyMock.VerifyGet(f => f.PrimaryColumns);
            expressionMock.VerifyGet(e => e.ForeignKey);
        }
    }
}


text:
# Disallow `.js` extension in dependency paths (no-js-extension)

## Rule Details

Dependency paths in RequireJS should not use a `.js` extension, since the path could be a for a package directory.

The following patterns are considered warnings:

```js
require(['foo.js'], function (foo) {
    /* ... */
});

define(['foo.js'], function (foo) {
    /* ... */
});

define(function (require) {
    var foo = require('foo.js');
    /* ... */
});
```

The following patterns are not warnings:

```js
require(['foo'], function (foo) {
    /* ... */
});

define(['foo'], function (foo) {
    /* ... */
});

define(function (require) {
    var foo = require('foo');
    /* ... */
});
```

## When Not To Use It

You should probably *not* disable this rule.

## Further Reading

* [RequireJS Usage](http://requirejs.org/docs/api.html#usage)


text:
package org.kie.api.event.kiebase;

import org.kie.api.definition.rule.Rule;

public interface AfterRuleRemovedEvent
    extends
    KieBaseEvent {
    Rule getRule();
}


text:
<?php

namespace League\Glide\Manipulators;

use Intervention\Image\Image;
use League\Glide\Manipulators\Helpers\Color;
use League\Glide\Manipulators\Helpers\Dimension;

/**
 * @property string $border
 * @property string $dpr
 */
class Border extends BaseManipulator
{
    /**
     * Perform border image manipulation.
     * @param  Image $image The source image.
     * @return Image The manipulated image.
     */
    public function run(Image $image)
    {
        if ($border = $this->getBorder($image)) {
            list($width, $color, $method) = $border;

            if ($method === 'overlay') {
                return $this->runOverlay($image, $width, $color);
            }

            if ($method === 'shrink') {
                return $this->runShrink($image, $width, $color);
            }

            if ($method === 'expand') {
                return $this->runExpand($image, $width, $color);
            }
        }

        return $image;
    }

    /**
     * Resolve border amount.
     * @param  Image  $image The source image.
     * @return string The resolved border amount.
     */
    public function getBorder(Image $image)
    {
        if (!$this->border) {
            return;
        }

        $values = explode(',', $this->border);

        $width = $this->getWidth($image, $this->getDpr(), isset($values[0]) ? $values[0] : null);
        $color = $this->getColor(isset($values[1]) ? $values[1] : null);
        $method = $this->getMethod(isset($values[2]) ? $values[2] : null);

        if ($width) {
            return [$width, $color, $method];
        }
    }

    /**
     * Get border width.
     * @param  Image  $image The source image.
     * @param  double $dpr   The device pixel ratio.
     * @param  string $width The border width.
     * @return double The resolved border width.
     */
    public function getWidth(Image $image, $dpr, $width)
    {
        return (new Dimension($image, $dpr))->get($width);
    }

    /**
     * Get formatted color.
     * @param  string $color The color.
     * @return string The formatted color.
     */
    public function getColor($color)
    {
        return (new Color($color))->formatted();
    }

    /**
     * Resolve the border method.
     * @param  string $method The raw border method.
     * @return string The resolved border method.
     */
    public function getMethod($method)
    {
        if (!in_array($method, ['expand', 'shrink', 'overlay'], true)) {
            return 'overlay';
        }

        return $method;
    }

    /**
     * Resolve the device pixel ratio.
     * @return double The device pixel ratio.
     */
    public function getDpr()
    {
        if (!is_numeric($this->dpr)) {
            return 1.0;
        }

        if ($this->dpr < 0 or $this->dpr > 8) {
            return 1.0;
        }

        return (double) $this->dpr;
    }

    /**
     * Run the overlay border method.
     * @param  Image  $image The source image.
     * @param  double $width The border width.
     * @param  string $color The border color.
     * @return Image  The manipulated image.
     */
    public function runOverlay(Image $image, $width, $color)
    {
        return $image->rectangle(
            $width / 2,
            $width / 2,
            $image->width() - ($width / 2),
            $image->height() - ($width / 2),
            function ($draw) use ($width, $color) {
                $draw->border($width, $color);
            }
        );
    }

    /**
     * Run the shrink border method.
     * @param  Image  $image The source image.
     * @param  double $width The border width.
     * @param  string $color The border color.
     * @return Image  The manipulated image.
     */
    public function runShrink(Image $image, $width, $color)
    {
        return $image
            ->resize(
                $image->width() - ($width * 2),
                $image->height() - ($width * 2)
            )
            ->resizeCanvas(
                $width * 2,
                $width * 2,
                'center',
                true,
                $color
            );
    }

    /**
     * Run the expand border method.
     * @param  Image  $image The source image.
     * @param  double $width The border width.
     * @param  string $color The border color.
     * @return Image  The manipulated image.
     */
    public function runExpand(Image $image, $width, $color)
    {
        return $image->resizeCanvas(
            $width * 2,
            $width * 2,
            'center',
            true,
            $color
        );
    }
}


text:
/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.xiaomi.infra.galaxy.metrics.thrift;

import libthrift091.scheme.IScheme;
import libthrift091.scheme.SchemeFactory;
import libthrift091.scheme.StandardScheme;

import libthrift091.scheme.TupleScheme;
import libthrift091.protocol.TTupleProtocol;
import libthrift091.protocol.TProtocolException;
import libthrift091.EncodingUtils;
import libthrift091.TException;
import libthrift091.async.AsyncMethodCallback;
import libthrift091.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-2")
public class AlertRuleKey implements libthrift091.TBase<AlertRuleKey, AlertRuleKey._Fields>, java.io.Serializable, Cloneable, Comparable<AlertRuleKey> {
  private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("AlertRuleKey");

  private static final libthrift091.protocol.TField METRIC_KEY_FIELD_DESC = new libthrift091.protocol.TField("metricKey", libthrift091.protocol.TType.STRUCT, (short)1);
  private static final libthrift091.protocol.TField OPERATOR_FIELD_DESC = new libthrift091.protocol.TField("operator", libthrift091.protocol.TType.I32, (short)2);
  private static final libthrift091.protocol.TField THRESHOLD_FIELD_DESC = new libthrift091.protocol.TField("threshold", libthrift091.protocol.TType.DOUBLE, (short)3);
  private static final libthrift091.protocol.TField TRIGGER_TIMES_FIELD_DESC = new libthrift091.protocol.TField("triggerTimes", libthrift091.protocol.TType.I32, (short)4);
  private static final libthrift091.protocol.TField MAX_ALERT_TIMES_FIELD_DESC = new libthrift091.protocol.TField("maxAlertTimes", libthrift091.protocol.TType.I32, (short)5);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new AlertRuleKeyStandardSchemeFactory());
    schemes.put(TupleScheme.class, new AlertRuleKeyTupleSchemeFactory());
  }

  public com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey; // optional
  /**
   *
   * @see OPERATOR
   */
  public OPERATOR operator; // optional
  public double threshold; // optional
  public int triggerTimes; // optional
  public int maxAlertTimes; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements libthrift091.TFieldIdEnum {
    METRIC_KEY((short)1, "metricKey"),
    /**
     *
     * @see OPERATOR
     */
    OPERATOR((short)2, "operator"),
    THRESHOLD((short)3, "threshold"),
    TRIGGER_TIMES((short)4, "triggerTimes"),
    MAX_ALERT_TIMES((short)5, "maxAlertTimes");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // METRIC_KEY
          return METRIC_KEY;
        case 2: // OPERATOR
          return OPERATOR;
        case 3: // THRESHOLD
          return THRESHOLD;
        case 4: // TRIGGER_TIMES
          return TRIGGER_TIMES;
        case 5: // MAX_ALERT_TIMES
          return MAX_ALERT_TIMES;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __THRESHOLD_ISSET_ID = 0;
  private static final int __TRIGGERTIMES_ISSET_ID = 1;
  private static final int __MAXALERTTIMES_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.METRIC_KEY,_Fields.OPERATOR,_Fields.THRESHOLD,_Fields.TRIGGER_TIMES,_Fields.MAX_ALERT_TIMES};
  public static final Map<_Fields, libthrift091.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.METRIC_KEY, new libthrift091.meta_data.FieldMetaData("metricKey", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, com.xiaomi.infra.galaxy.metrics.thrift.MetricKey.class)));
    tmpMap.put(_Fields.OPERATOR, new libthrift091.meta_data.FieldMetaData("operator", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.EnumMetaData(libthrift091.protocol.TType.ENUM, OPERATOR.class)));
    tmpMap.put(_Fields.THRESHOLD, new libthrift091.meta_data.FieldMetaData("threshold", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.TRIGGER_TIMES, new libthrift091.meta_data.FieldMetaData("triggerTimes", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32)));
    tmpMap.put(_Fields.MAX_ALERT_TIMES, new libthrift091.meta_data.FieldMetaData("maxAlertTimes", libthrift091.TFieldRequirementType.OPTIONAL,
        new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(AlertRuleKey.class, metaDataMap);
  }

  public AlertRuleKey() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public AlertRuleKey(AlertRuleKey other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetMetricKey()) {
      this.metricKey = new com.xiaomi.infra.galaxy.metrics.thrift.MetricKey(other.metricKey);
    }
    if (other.isSetOperator()) {
      this.operator = other.operator;
    }
    this.threshold = other.threshold;
    this.triggerTimes = other.triggerTimes;
    this.maxAlertTimes = other.maxAlertTimes;
  }

  public AlertRuleKey deepCopy() {
    return new AlertRuleKey(this);
  }

  @Override
  public void clear() {
    this.metricKey = null;
    this.operator = null;
    setThresholdIsSet(false);
    this.threshold = 0.0;
    setTriggerTimesIsSet(false);
    this.triggerTimes = 0;
    setMaxAlertTimesIsSet(false);
    this.maxAlertTimes = 0;
  }

  public com.xiaomi.infra.galaxy.metrics.thrift.MetricKey getMetricKey() {
    return this.metricKey;
  }

  public AlertRuleKey setMetricKey(com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey) {
    this.metricKey = metricKey;
    return this;
  }

  public void unsetMetricKey() {
    this.metricKey = null;
  }

  /** Returns true if field metricKey is set (has been assigned a value) and false otherwise */
  public boolean isSetMetricKey() {
    return this.metricKey != null;
  }

  public void setMetricKeyIsSet(boolean value) {
    if (!value) {
      this.metricKey = null;
    }
  }

  /**
   *
   * @see OPERATOR
   */
  public OPERATOR getOperator() {
    return this.operator;
  }

  /**
   *
   * @see OPERATOR
   */
  public AlertRuleKey setOperator(OPERATOR operator) {
    this.operator = operator;
    return this;
  }

  public void unsetOperator() {
    this.operator = null;
  }

  /** Returns true if field operator is set (has been assigned a value) and false otherwise */
  public boolean isSetOperator() {
    return this.operator != null;
  }

  public void setOperatorIsSet(boolean value) {
    if (!value) {
      this.operator = null;
    }
  }

  public double getThreshold() {
    return this.threshold;
  }

  public AlertRuleKey setThreshold(double threshold) {
    this.threshold = threshold;
    setThresholdIsSet(true);
    return this;
  }

  public void unsetThreshold() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __THRESHOLD_ISSET_ID);
  }

  /** Returns true if field threshold is set (has been assigned a value) and false otherwise */
  public boolean isSetThreshold() {
    return EncodingUtils.testBit(__isset_bitfield, __THRESHOLD_ISSET_ID);
  }

  public void setThresholdIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __THRESHOLD_ISSET_ID, value);
  }

  public int getTriggerTimes() {
    return this.triggerTimes;
  }

  public AlertRuleKey setTriggerTimes(int triggerTimes) {
    this.triggerTimes = triggerTimes;
    setTriggerTimesIsSet(true);
    return this;
  }

  public void unsetTriggerTimes() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TRIGGERTIMES_ISSET_ID);
  }

  /** Returns true if field triggerTimes is set (has been assigned a value) and false otherwise */
  public boolean isSetTriggerTimes() {
    return EncodingUtils.testBit(__isset_bitfield, __TRIGGERTIMES_ISSET_ID);
  }

  public void setTriggerTimesIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TRIGGERTIMES_ISSET_ID, value);
  }

  public int getMaxAlertTimes() {
    return this.maxAlertTimes;
  }

  public AlertRuleKey setMaxAlertTimes(int maxAlertTimes) {
    this.maxAlertTimes = maxAlertTimes;
    setMaxAlertTimesIsSet(true);
    return this;
  }

  public void unsetMaxAlertTimes() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXALERTTIMES_ISSET_ID);
  }

  /** Returns true if field maxAlertTimes is set (has been assigned a value) and false otherwise */
  public boolean isSetMaxAlertTimes() {
    return EncodingUtils.testBit(__isset_bitfield, __MAXALERTTIMES_ISSET_ID);
  }

  public void setMaxAlertTimesIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXALERTTIMES_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case METRIC_KEY:
      if (value == null) {
        unsetMetricKey();
      } else {
        setMetricKey((com.xiaomi.infra.galaxy.metrics.thrift.MetricKey)value);
      }
      break;

    case OPERATOR:
      if (value == null) {
        unsetOperator();
      } else {
        setOperator((OPERATOR)value);
      }
      break;

    case THRESHOLD:
      if (value == null) {
        unsetThreshold();
      } else {
        setThreshold((Double)value);
      }
      break;

    case TRIGGER_TIMES:
      if (value == null) {
        unsetTriggerTimes();
      } else {
        setTriggerTimes((Integer)value);
      }
      break;

    case MAX_ALERT_TIMES:
      if (value == null) {
        unsetMaxAlertTimes();
      } else {
        setMaxAlertTimes((Integer)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case METRIC_KEY:
      return getMetricKey();

    case OPERATOR:
      return getOperator();

    case THRESHOLD:
      return Double.valueOf(getThreshold());

    case TRIGGER_TIMES:
      return Integer.valueOf(getTriggerTimes());

    case MAX_ALERT_TIMES:
      return Integer.valueOf(getMaxAlertTimes());

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case METRIC_KEY:
      return isSetMetricKey();
    case OPERATOR:
      return isSetOperator();
    case THRESHOLD:
      return isSetThreshold();
    case TRIGGER_TIMES:
      return isSetTriggerTimes();
    case MAX_ALERT_TIMES:
      return isSetMaxAlertTimes();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof AlertRuleKey)
      return this.equals((AlertRuleKey)that);
    return false;
  }

  public boolean equals(AlertRuleKey that) {
    if (that == null)
      return false;

    boolean this_present_metricKey = true && this.isSetMetricKey();
    boolean that_present_metricKey = true && that.isSetMetricKey();
    if (this_present_metricKey || that_present_metricKey) {
      if (!(this_present_metricKey && that_present_metricKey))
        return false;
      if (!this.metricKey.equals(that.metricKey))
        return false;
    }

    boolean this_present_operator = true && this.isSetOperator();
    boolean that_present_operator = true && that.isSetOperator();
    if (this_present_operator || that_present_operator) {
      if (!(this_present_operator && that_present_operator))
        return false;
      if (!this.operator.equals(that.operator))
        return false;
    }

    boolean this_present_threshold = true && this.isSetThreshold();
    boolean that_present_threshold = true && that.isSetThreshold();
    if (this_present_threshold || that_present_threshold) {
      if (!(this_present_threshold && that_present_threshold))
        return false;
      if (this.threshold != that.threshold)
        return false;
    }

    boolean this_present_triggerTimes = true && this.isSetTriggerTimes();
    boolean that_present_triggerTimes = true && that.isSetTriggerTimes();
    if (this_present_triggerTimes || that_present_triggerTimes) {
      if (!(this_present_triggerTimes && that_present_triggerTimes))
        return false;
      if (this.triggerTimes != that.triggerTimes)
        return false;
    }

    boolean this_present_maxAlertTimes = true && this.isSetMaxAlertTimes();
    boolean that_present_maxAlertTimes = true && that.isSetMaxAlertTimes();
    if (this_present_maxAlertTimes || that_present_maxAlertTimes) {
      if (!(this_present_maxAlertTimes && that_present_maxAlertTimes))
        return false;
      if (this.maxAlertTimes != that.maxAlertTimes)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List<Object> list = new ArrayList<Object>();

    boolean present_metricKey = true && (isSetMetricKey());
    list.add(present_metricKey);
    if (present_metricKey)
      list.add(metricKey);

    boolean present_operator = true && (isSetOperator());
    list.add(present_operator);
    if (present_operator)
      list.add(operator.getValue());

    boolean present_threshold = true && (isSetThreshold());
    list.add(present_threshold);
    if (present_threshold)
      list.add(threshold);

    boolean present_triggerTimes = true && (isSetTriggerTimes());
    list.add(present_triggerTimes);
    if (present_triggerTimes)
      list.add(triggerTimes);

    boolean present_maxAlertTimes = true && (isSetMaxAlertTimes());
    list.add(present_maxAlertTimes);
    if (present_maxAlertTimes)
      list.add(maxAlertTimes);

    return list.hashCode();
  }

  @Override
  public int compareTo(AlertRuleKey other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetMetricKey()).compareTo(other.isSetMetricKey());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMetricKey()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.metricKey, other.metricKey);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOperator()).compareTo(other.isSetOperator());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOperator()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.operator, other.operator);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetThreshold()).compareTo(other.isSetThreshold());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetThreshold()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.threshold, other.threshold);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTriggerTimes()).compareTo(other.isSetTriggerTimes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTriggerTimes()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.triggerTimes, other.triggerTimes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxAlertTimes()).compareTo(other.isSetMaxAlertTimes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxAlertTimes()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.maxAlertTimes, other.maxAlertTimes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("AlertRuleKey(");
    boolean first = true;

    if (isSetMetricKey()) {
      sb.append("metricKey:");
      if (this.metricKey == null) {
        sb.append("null");
      } else {
        sb.append(this.metricKey);
      }
      first = false;
    }
    if (isSetOperator()) {
      if (!first) sb.append(", ");
      sb.append("operator:");
      if (this.operator == null) {
        sb.append("null");
      } else {
        sb.append(this.operator);
      }
      first = false;
    }
    if (isSetThreshold()) {
      if (!first) sb.append(", ");
      sb.append("threshold:");
      sb.append(this.threshold);
      first = false;
    }
    if (isSetTriggerTimes()) {
      if (!first) sb.append(", ");
      sb.append("triggerTimes:");
      sb.append(this.triggerTimes);
      first = false;
    }
    if (isSetMaxAlertTimes()) {
      if (!first) sb.append(", ");
      sb.append("maxAlertTimes:");
      sb.append(this.maxAlertTimes);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws libthrift091.TException {
    // check for required fields
    // check for sub-struct validity
    if (metricKey != null) {
      metricKey.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out)));
    } catch (libthrift091.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in)));
    } catch (libthrift091.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class AlertRuleKeyStandardSchemeFactory implements SchemeFactory {
    public AlertRuleKeyStandardScheme getScheme() {
      return new AlertRuleKeyStandardScheme();
    }
  }

  private static class AlertRuleKeyStandardScheme extends StandardScheme<AlertRuleKey> {

    public void read(libthrift091.protocol.TProtocol iprot, AlertRuleKey struct) throws libthrift091.TException {
      libthrift091.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == libthrift091.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // METRIC_KEY
            if (schemeField.type == libthrift091.protocol.TType.STRUCT) {
              struct.metricKey = new com.xiaomi.infra.galaxy.metrics.thrift.MetricKey();
              struct.metricKey.read(iprot);
              struct.setMetricKeyIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // OPERATOR
            if (schemeField.type == libthrift091.protocol.TType.I32) {
              struct.operator = com.xiaomi.infra.galaxy.metrics.thrift.OPERATOR.findByValue(iprot.readI32());
              struct.setOperatorIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // THRESHOLD
            if (schemeField.type == libthrift091.protocol.TType.DOUBLE) {
              struct.threshold = iprot.readDouble();
              struct.setThresholdIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // TRIGGER_TIMES
            if (schemeField.type == libthrift091.protocol.TType.I32) {
              struct.triggerTimes = iprot.readI32();
              struct.setTriggerTimesIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // MAX_ALERT_TIMES
            if (schemeField.type == libthrift091.protocol.TType.I32) {
              struct.maxAlertTimes = iprot.readI32();
              struct.setMaxAlertTimesIsSet(true);
            } else {
              libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(libthrift091.protocol.TProtocol oprot, AlertRuleKey struct) throws libthrift091.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.metricKey != null) {
        if (struct.isSetMetricKey()) {
          oprot.writeFieldBegin(METRIC_KEY_FIELD_DESC);
          struct.metricKey.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.operator != null) {
        if (struct.isSetOperator()) {
          oprot.writeFieldBegin(OPERATOR_FIELD_DESC);
          oprot.writeI32(struct.operator.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetThreshold()) {
        oprot.writeFieldBegin(THRESHOLD_FIELD_DESC);
        oprot.writeDouble(struct.threshold);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTriggerTimes()) {
        oprot.writeFieldBegin(TRIGGER_TIMES_FIELD_DESC);
        oprot.writeI32(struct.triggerTimes);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxAlertTimes()) {
        oprot.writeFieldBegin(MAX_ALERT_TIMES_FIELD_DESC);
        oprot.writeI32(struct.maxAlertTimes);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class AlertRuleKeyTupleSchemeFactory implements SchemeFactory {
    public AlertRuleKeyTupleScheme getScheme() {
      return new AlertRuleKeyTupleScheme();
    }
  }

  private static class AlertRuleKeyTupleScheme extends TupleScheme<AlertRuleKey> {

    @Override
    public void write(libthrift091.protocol.TProtocol prot, AlertRuleKey struct) throws libthrift091.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetMetricKey()) {
        optionals.set(0);
      }
      if (struct.isSetOperator()) {
        optionals.set(1);
      }
      if (struct.isSetThreshold()) {
        optionals.set(2);
      }
      if (struct.isSetTriggerTimes()) {
        optionals.set(3);
      }
      if (struct.isSetMaxAlertTimes()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetMetricKey()) {
        struct.metricKey.write(oprot);
      }
      if (struct.isSetOperator()) {
        oprot.writeI32(struct.operator.getValue());
      }
      if (struct.isSetThreshold()) {
        oprot.writeDouble(struct.threshold);
      }
      if (struct.isSetTriggerTimes()) {
        oprot.writeI32(struct.triggerTimes);
      }
      if (struct.isSetMaxAlertTimes()) {
        oprot.writeI32(struct.maxAlertTimes);
      }
    }

    @Override
    public void read(libthrift091.protocol.TProtocol prot, AlertRuleKey struct) throws libthrift091.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.metricKey = new com.xiaomi.infra.galaxy.metrics.thrift.MetricKey();
        struct.metricKey.read(iprot);
        struct.setMetricKeyIsSet(true);
      }
      if (incoming.get(1)) {
        struct.operator = com.xiaomi.infra.galaxy.metrics.thrift.OPERATOR.findByValue(iprot.readI32());
        struct.setOperatorIsSet(true);
      }
      if (incoming.get(2)) {
        struct.threshold = iprot.readDouble();
        struct.setThresholdIsSet(true);
      }
      if (incoming.get(3)) {
        struct.triggerTimes = iprot.readI32();
        struct.setTriggerTimesIsSet(true);
      }
      if (incoming.get(4)) {
        struct.maxAlertTimes = iprot.readI32();
        struct.setMaxAlertTimesIsSet(true);
      }
    }
  }

}


text:
define("dojox/mobile/Switch", [
	"dojo/_base/array",
	"dojo/_base/connect",
	"dojo/_base/declare",
	"dojo/_base/event",
	"dojo/_base/window",
	"dojo/dom-class",
	"dojo/dom-construct",
	"dojo/dom-style",
	"dojo/dom-attr",
	"dojo/touch",
	"dijit/_Contained",
	"dijit/_WidgetBase",
	"./sniff",
	"./_maskUtils",
	"./common",
	"dojo/has!dojo-bidi?dojox/mobile/bidi/Switch"
], function(array, connect, declare, event, win, domClass, domConstruct, domStyle, domAttr, touch, Contained, WidgetBase, has, maskUtils, dm, BidiSwitch){

	// module:
	//		dojox/mobile/Switch

	var Switch = declare(has("dojo-bidi") ? "dojox.mobile.NonBidiSwitch" : "dojox.mobile.Switch", [WidgetBase, Contained],{
		// summary:
		//		A toggle switch with a sliding knob.
		// description:
		//		Switch is a toggle switch with a sliding knob. You can either
		//		tap or slide the knob to toggle the switch. The onStateChanged
		//		handler is called when the switch is manipulated.

		// value: String
		//		The initial state of the switch: "on" or "off". The default
		//		value is "on".
		value: "on",

		// name: String
		//		A name for a hidden input field, which holds the current value.
		name: "",

		// leftLabel: String
		//		The left-side label of the switch.
		leftLabel: "ON",

		// rightLabel: String
		//		The right-side label of the switch.
		rightLabel: "OFF",

		// shape: String
		//		The shape of the switch.
		//		"mblSwDefaultShape", "mblSwSquareShape", "mblSwRoundShape1",
		//		"mblSwRoundShape2", "mblSwArcShape1" or "mblSwArcShape2".
		//		The default value is "mblSwDefaultShape".
		shape: "mblSwDefaultShape",

		// tabIndex: String
		//		Tabindex setting for this widget so users can hit the tab key to
		//		focus on it.
		tabIndex: "0",
		_setTabIndexAttr: "", // sets tabIndex to domNode

		/* internal properties */
		baseClass: "mblSwitch",
		// role: [private] String
		//		The accessibility role.
		role: "", // a11y

		buildRendering: function(){
			if(!this.templateString){ // true if this widget is not templated
				this.domNode = (this.srcNodeRef && this.srcNodeRef.tagName === "SPAN") ?
					this.srcNodeRef : domConstruct.create("span");
			}
			// prevent browser scrolling on IE10 (evt.preventDefault() is not enough)
			if(typeof this.domNode.style.msTouchAction != "undefined"){
				this.domNode.style.msTouchAction = "none";
			}
			this.inherited(arguments);
			if(!this.templateString){ // true if this widget is not templated
				var c = (this.srcNodeRef && this.srcNodeRef.className) || this.className || this["class"];
				if((c = c.match(/mblSw.*Shape\d*/))){ this.shape = c; }
				domClass.add(this.domNode, this.shape);
				var nameAttr = this.name ? " name=\"" + this.name + "\"" : "";
				this.domNode.innerHTML =
					  '
'
					+	'
'
					+		'

'
					+	'
'
					+	'
'
					+		'

'
					+	'
'
					+	'

'
					+	'<input type="hidden"'+nameAttr+'>
'
					+ '
';
				var n = this.inner = this.domNode.firstChild;
				this.left = n.childNodes[0];
				this.right = n.childNodes[1];
				this.knob = n.childNodes[2];
				this.input = n.childNodes[3];
			}
			domAttr.set(this.domNode, "role", "checkbox"); //a11y
			domAttr.set(this.domNode, "aria-checked", (this.value === "on") ? "true" : "false"); //a11y

			this.switchNode = this.domNode;

			if(has("windows-theme")) {
				var rootNode = domConstruct.create("div", {className: "mblSwitchContainer"});
				this.labelNode = domConstruct.create("label", {"class": "mblSwitchLabel", "for": this.id}, rootNode);
				rootNode.appendChild(this.domNode.cloneNode(true));
				this.domNode = rootNode;
				this.focusNode = rootNode.childNodes[1];
				this.labelNode.innerHTML = (this.value=="off") ? this.rightLabel : this.leftLabel;
				this.switchNode = this.domNode.childNodes[1];
				var inner = this.inner = this.domNode.childNodes[1].firstChild;
				this.left = inner.childNodes[0];
				this.right = inner.childNodes[1];
				this.knob = inner.childNodes[2];
				this.input = inner.childNodes[3];
			}
		},

		postCreate: function(){
			this.connect(this.switchNode, "onclick", "_onClick");
			this.connect(this.switchNode, "onkeydown", "_onClick"); // for desktop browsers
			this._startHandle = this.connect(this.switchNode, touch.press, "onTouchStart");
			this._initialValue = this.value; // for reset()
		},

		startup: function(){
			if(!this._started){
				this.resize();
			}
		},

		resize: function(){
			if(has("windows-theme")){
				// Override the custom CSS width (if any) to avoid misplacement.
				// Per design, the windows theme does not allow resizing the controls.
				// The label of the switch is placed next to the switch, and a custom
				// width would only have the effect to increase the distance between the
				// label and the switch, which is undesired. Hence, on windows theme,
				// ensure the width of root DOM node is 100%.
				domStyle.set(this.domNode, "width", "100%");
			}else{
				var value = domStyle.get(this.domNode,"width");
				var outWidth = value + "px";
				var innWidth = (value - domStyle.get(this.knob,"width")) + "px";
				domStyle.set(this.left, "width", outWidth);
				domStyle.set(this.right,this.isLeftToRight()?{width: outWidth, left: innWidth}:{width: outWidth});
				domStyle.set(this.left.firstChild, "width", innWidth);
				domStyle.set(this.right.firstChild, "width", innWidth);
				domStyle.set(this.knob, "left", innWidth);
				if(this.value == "off"){
					domStyle.set(this.inner, "left", this.isLeftToRight()?("-" + innWidth):0);
				}
				this._hasMaskImage = false;
				this._createMaskImage();
			}
		},

		_changeState: function(/*String*/state, /*Boolean*/anim){
			var on = (state === "on");
			this.left.style.display = "";
			this.right.style.display = "";
			this.inner.style.left = "";
			if(anim){
				domClass.add(this.switchNode, "mblSwitchAnimation");
			}
			domClass.remove(this.switchNode, on ? "mblSwitchOff" : "mblSwitchOn");
			domClass.add(this.switchNode, on ? "mblSwitchOn" : "mblSwitchOff");
			domAttr.set(this.switchNode, "aria-checked", on ? "true" : "false"); //a11y

			if(!on && !has("windows-theme")){
				this.inner.style.left  = (this.isLeftToRight()?(-(domStyle.get(this.domNode,"width") - domStyle.get(this.knob,"width"))):0) + "px";
			}

			var _this = this;
			_this.defer(function(){
				_this.left.style.display = on ? "" : "none";
				_this.right.style.display = !on ? "" : "none";
				domClass.remove(_this.switchNode, "mblSwitchAnimation");
			}, anim ? 300 : 0);
		},

		_createMaskImage: function(){
			if(this._timer){
				 this._timer.remove();
				 delete this._timer;
			}
			if(this._hasMaskImage){ return; }
			var w = domStyle.get(this.domNode,"width"), h = domStyle.get(this.domNode,"height");
			this._width = (w - domStyle.get(this.knob,"width"));
			this._hasMaskImage = true;
			if(!(has("mask-image"))){ return; }
			var rDef = domStyle.get(this.left, "borderTopLeftRadius");
			if(rDef == "0px"){ return; }
			var rDefs = rDef.split(" ");
			var rx = parseFloat(rDefs[0]), ry = (rDefs.length == 1) ? rx : parseFloat(rDefs[1]);
			var id = (this.shape+"Mask"+w+h+rx+ry).replace(/\./,"_");

			maskUtils.createRoundMask(this.switchNode, 0, 0, 0, 0, w, h, rx, ry, 1);
		},

		_onClick: function(e){
			// summary:
			//		Internal handler for click events.
			// tags:
			//		private
			if(e && e.type === "keydown" && e.keyCode !== 13){ return; }
			if(this.onClick(e) === false){ return; } // user's click action
			if(this._moved){ return; }
			this._set("value", this.input.value = (this.value == "on") ? "off" : "on");
			this._changeState(this.value, true);
			this.onStateChanged(this.value);
		},

		onClick: function(/*Event*/ /*===== e =====*/){
			// summary:
			//		User defined function to handle clicks
			// tags:
			//		callback
		},

		onTouchStart: function(/*Event*/e){
			// summary:
			//		Internal function to handle touchStart events.
			this._moved = false;
			this.innerStartX = this.inner.offsetLeft;
			if(!this._conn){
				this._conn = [
					this.connect(this.inner, touch.move, "onTouchMove"),
					this.connect(win.doc, touch.release, "onTouchEnd")
				];

				/* While moving the slider knob sometimes IE fires MSPointerCancel event. That prevents firing
				MSPointerUp event (http://msdn.microsoft.com/ru-ru/library/ie/hh846776%28v=vs.85%29.aspx) so the
				knob can be stuck in the middle of the switch. As a fix we handle MSPointerCancel event with the
				same lintener as for MSPointerUp event.
				*/
				if(has("windows-theme")){
					this._conn.push(this.connect(win.doc, "MSPointerCancel", "onTouchEnd"));
				}
			}
			this.touchStartX = e.touches ? e.touches[0].pageX : e.clientX;
			this.left.style.display = "";
			this.right.style.display = "";
			event.stop(e);
			this._createMaskImage();
		},

		onTouchMove: function(/*Event*/e){
			// summary:
			//		Internal function to handle touchMove events.
			e.preventDefault();
			var dx;
			if(e.targetTouches){
				if(e.targetTouches.length != 1){ return; }
				dx = e.targetTouches[0].clientX - this.touchStartX;
			}else{
				dx = e.clientX - this.touchStartX;
			}
			var pos = this.innerStartX + dx;
			var d = 10;
			if(pos <= -(this._width-d)){ pos = -this._width; }
			if(pos >= -d){ pos = 0; }
			this.inner.style.left = pos + "px";
			if(Math.abs(dx) > d){
				this._moved = true;
			}
		},

		onTouchEnd: function(/*Event*/e){
			// summary:
			//		Internal function to handle touchEnd events.
			array.forEach(this._conn, connect.disconnect);
			this._conn = null;
			if(this.innerStartX == this.inner.offsetLeft){
				// need to send a synthetic click?
				if(has("touch") && has("clicks-prevented")){
					dm._sendClick(this.inner, e);
				}
				return;
			}
			var newState = (this.inner.offsetLeft < -(this._width/2)) ? "off" : "on";
			newState = this._newState(newState);
			this._changeState(newState, true);
			if(newState != this.value){
				this._set("value", this.input.value = newState);
				this.onStateChanged(newState);
			}
		},
		_newState: function(newState){
			return newState;
		},
		onStateChanged: function(/*String*/newState){
			// summary:
			//		Stub function to connect to from your application.
			// description:
			//		Called when the state has been changed.
			if (this.labelNode) {
				this.labelNode.innerHTML = newState=='off' ? this.rightLabel : this.leftLabel;
			}
		},

		_setValueAttr: function(/*String*/value){
			this._changeState(value, false);
			if(this.value != value){
				this._set("value", this.input.value = value);
				this.onStateChanged(value);
			}
		},

		_setLeftLabelAttr: function(/*String*/label){
			this.leftLabel = label;
			this.left.firstChild.innerHTML = this._cv ? this._cv(label) : label;
		},

		_setRightLabelAttr: function(/*String*/label){
			this.rightLabel = label;
			this.right.firstChild.innerHTML = this._cv ? this._cv(label) : label;
		},

		reset: function(){
			// summary:
			//		Reset the widget's value to what it was at initialization time
			this.set("value", this._initialValue);
		}
	});

	return has("dojo-bidi") ? declare("dojox.mobile.Switch", [Switch, BidiSwitch]) : Switch;
});


text:
/* @flow */
/* eslint-disable no-console */
import type { StyleType } from '../../../flowtypes/StyleType'

function addLogger(style: Object, type: StyleType): Object {
  if (process.env.NODE_ENV !== 'production') {
    console.log(type, { ...style })
  }

  return style
}

export default () => addLogger


text:
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema;

namespace Microsoft.Azure.WebJobs.Script.WebHost
{
    internal class ScriptSecretSerializerV0 : IScriptSecretSerializer
    {
        private const string MasterKeyPropertyName = "masterKey";
        private const string HostFunctionKeyPropertyName = "functionKey";
        private const string FunctionKeyPropertyName = "key";

        public string SerializeSecrets<T>(T secrets) where T : ScriptSecrets
        {
            if (secrets is FunctionSecrets)
            {
                return SerializeFunctionSecrets(secrets as FunctionSecrets);
            }
            else if (secrets is HostSecrets)
            {
                return SerializeHostSecrets(secrets as HostSecrets);
            }

            return null;
        }

        public T DeserializeSecrets<T>(JObject secrets) where T : ScriptSecrets
        {
            var secretsType = typeof(T);
            if (typeof(FunctionSecrets).IsAssignableFrom(secretsType))
            {
                return DeserializeFunctionSecrets(secrets) as T;
            }
            else if (typeof(HostSecrets).IsAssignableFrom(secretsType))
            {
                return DeserializeHostSecrets(secrets) as T;
            }

            return default(T);
        }

        private static FunctionSecrets DeserializeFunctionSecrets(JObject secrets)
        {
            string key = secrets.Value<string>(FunctionKeyPropertyName);
            IList<Key> keys = CreateFunctionKeysCollection(key);

            return new FunctionSecrets(keys);
        }

        private static HostSecrets DeserializeHostSecrets(JObject secrets)
        {
            string masterSecret = secrets.Value<string>(MasterKeyPropertyName);
            string functionSecret = secrets.Value<string>(HostFunctionKeyPropertyName);

            return new HostSecrets
            {
                MasterKey = CreateKeyFromSecret(masterSecret, ScriptConstants.DefaultMasterKeyName),
                FunctionKeys = CreateFunctionKeysCollection(functionSecret)
            };
        }

        private static string SerializeFunctionSecrets(FunctionSecrets secrets)
        {
            // Output:
            //  { "key" : "keyvalue" }

            var functionSecrets = new JObject
            {
                [FunctionKeyPropertyName] = GetFunctionKeyFromCollection(secrets?.Keys)
            };

            return functionSecrets.ToString();
        }

        private static string SerializeHostSecrets(HostSecrets secrets)
        {
            // Output:
            //  {
            //    "masterKey" : "masterkeyvalue",
            //    "functionKey" : "functionkeyvalue"
            //  }

            var hostSecrets = new JObject
            {
                [MasterKeyPropertyName] = secrets.MasterKey.Value,
                [HostFunctionKeyPropertyName] = GetFunctionKeyFromCollection(secrets.FunctionKeys)
            };

            return hostSecrets.ToString();
        }

        private static IList<Key> CreateFunctionKeysCollection(string functionKey)
        {
            var keys = new List<Key>();

            if (functionKey != null)
            {
                keys.Add(CreateKeyFromSecret(functionKey, ScriptConstants.DefaultFunctionKeyName));
            }

            return keys;
        }

        private static string GetFunctionKeyFromCollection(IList<Key> keys)
        {
            Key key = keys?.FirstOrDefault();

            return keys?.FirstOrDefault(s => string.Equals(s.Name, ScriptConstants.DefaultFunctionKeyName))?.Value
                ?? key?.Value;
        }

        private static Key CreateKeyFromSecret(string secret, string name = "") => new Key(name, secret);

        public bool CanSerialize(JObject functionSecrets, Type type)
        {
            if (type == typeof(HostSecrets))
            {
                return functionSecrets != null &&
                    functionSecrets.Type == JTokenType.Object &&
                    functionSecrets["masterKey"]?.Type == JTokenType.String;
            }
            else if (type == typeof(FunctionSecrets))
            {
                return functionSecrets != null &&
                    functionSecrets.Type == JTokenType.Object &&
                    (functionSecrets["key"]?.Type == JTokenType.String || functionSecrets["key"]?.Type == JTokenType.Null);
            }

            return false;
        }
    }
}