com.trendmicro.ds.appcontrol.rest.object

## Class Rule

- java.lang.Object
- - com.trendmicro.ds.appcontrol.rest.object.Rule

-     public class Rule
      extends java.lang.Object

  Details of a rule.
  See Also:
    `Ruleset`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Rule.Action` The actions that can be taken when an application named in a rule is launched.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Rule()` Create a new empty rule.
    `Rule(java.lang.Long ruleID, java.lang.String sha256, long size, java.lang.String path, java.lang.String filename, Rule.Action action)` Create a new rule with a named executable and action.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Rule.Action` | `getAction()` Get the action to take when a user attempts to launch the executable named in the rule.
    `java.lang.String` | `getFileName()` Get the filename (excluding path) of the executable named in the rule.
    `java.lang.String` | `getPath()` Get the full path (excluding filename) of the executable named in the rule.
    `java.lang.Long` | `getRuleID()` The rule ID.
    `java.lang.String` | `getSha256()` Get the SHA-256 hash of the executable named in the rule.
    `long` | `getSize()` Get the size of the executable named in the rule.
    `void` | `setAction(Rule.Action action)` Set the action to take when a user attempts to launch the executable named in the rule.
    `void` | `setFileName(java.lang.String filename)` Set the filename (excluding path) of the executable named in the rule.
    `void` | `setPath(java.lang.String path)` Set the full path (excluding filename) of the executable named in the rule.
    `void` | `setRuleID(java.lang.Long ruleID)` Set the rule ID
    `void` | `setSha256(java.lang.String sha256)` Set the SHA-256 hash of the executable named in the rule.
    `void` | `setSize(long size)` Set the size of the executable named in the rule.
    `java.lang.String` | `toString()`
    `Rule` | `withAction(Rule.Action action)` Set the action to take when a user attempts to launch the executable named in the rule.
    `Rule` | `withFileName(java.lang.String filename)` Set the filename (excluding path) of the executable named in the rule.
    `Rule` | `withPath(java.lang.String path)` Set the full path (excluding filename) of the executable named in the rule.
    `Rule` | `withRuleID(java.lang.Long ruleID)` Set the rule ID
    `Rule` | `withSha256(java.lang.String sha256)` Set the SHA-256 hash of the executable named in the rule.
    `Rule` | `withSize(long size)` Set the size of the executable named in the rule.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Rule

          public Rule()

      Create a new empty rule.

    - #### Rule

          public Rule(java.lang.Long ruleID,
                      java.lang.String sha256,
                      long size,
                      java.lang.String path,
                      java.lang.String filename,
                      Rule.Action action)

      Create a new rule with a named executable and action.
      Parameters:
        `sha256` - the SHA-256 hash of the executable named in the rule.
        `size` - the size of the executable named in the rule.
        `path` - the full path (excluding filename) of the executable named in the rule.
        `filename` - the filename of the executable named in the rule.
        `action` - the action to take when a user attempts to launch the executable named in the rule.

        IMPORTANT: The actual behavior of application control is controlled by policy. To block applications from being launched, application control must be enabled.

  - ### Method Detail

    - #### getSha256

          public java.lang.String getSha256()

      Get the SHA-256 hash of the executable named in the rule.
      Returns:
        the SHA-256 hash of the executable named in the rule.

    - #### setSha256

          public void setSha256(java.lang.String sha256)

      Set the SHA-256 hash of the executable named in the rule.
      Parameters:
        `sha256` - the SHA-256 hash of the executable named in the rule.

    - #### withSha256

          public Rule withSha256(java.lang.String sha256)

      Set the SHA-256 hash of the executable named in the rule.
      Parameters:
        `sha256` - the SHA-256 hash of the executable named in the rule.
      Returns:
        the updated Rule object.

    - #### getSize

          public long getSize()

      Get the size of the executable named in the rule.
      Returns:
        the size of the executable named in the rule.

    - #### setSize

          public void setSize(long size)

      Set the size of the executable named in the rule.
      Parameters:
        `size` - the size of the executable named in the rule.

    - #### withSize

          public Rule withSize(long size)

      Set the size of the executable named in the rule.
      Parameters:
        `size` - the size of the executable named in the rule.

    - #### getPath

          public java.lang.String getPath()

      Get the full path (excluding filename) of the executable named in the rule.
      Returns:
        the full path (excluding filename) of the executable named in the rule.

    - #### setPath

          public void setPath(java.lang.String path)

      Set the full path (excluding filename) of the executable named in the rule.
      Parameters:
        `path` - the full path (excluding filename) of the executable named in the rule.

    - #### withPath

          public Rule withPath(java.lang.String path)

      Set the full path (excluding filename) of the executable named in the rule.
      Parameters:
        `path` - the full path (excluding filename) of the executable named in the rule.
      Returns:
        the updated Rule object.

    - #### getFileName

          public java.lang.String getFileName()

      Get the filename (excluding path) of the executable named in the rule.
      Returns:
        the filename (excluding path) of the executable named in the rule.

    - #### setFileName

          public void setFileName(java.lang.String filename)

      Set the filename (excluding path) of the executable named in the rule.
      Parameters:
        `path` - the filename (excluding path) of the executable named in the rule.

    - #### withFileName

          public Rule withFileName(java.lang.String filename)

      Set the filename (excluding path) of the executable named in the rule.
      Parameters:
        `filename` - the filename (excluding path) of the executable named in the rule.
      Returns:
        the updated Rule object.

    - #### getAction

          public Rule.Action getAction()

      Get the action to take when a user attempts to launch the executable named in the rule.

      IMPORTANT: The actual behavior of application control is controlled by policy. To block applications from being launched, application control must be enabled.

      Returns:
        the action to take when a user attempts to launch the executable named in the rule.

    - #### setAction

          public void setAction(Rule.Action action)

      Set the action to take when a user attempts to launch the executable named in the rule.

      IMPORTANT: The actual behavior of application control is controlled by policy. To block applications from being launched, application control must be enabled.

      Parameters:
        `action` - the action to take when a user attempts to launch the executable named in the rule.

    - #### withAction

          public Rule withAction(Rule.Action action)

      Set the action to take when a user attempts to launch the executable named in the rule.

      IMPORTANT: The actual behavior of application control is controlled by policy. To block applications from being launched, application control must be enabled.

      Parameters:
        `action` - the action to take when a user attempts to launch the executable named in the rule.
      Returns:
        the updated Rule object.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getRuleID

          public java.lang.Long getRuleID()

      The rule ID.
      Returns:
        the rule ID

    - #### setRuleID

          public void setRuleID(java.lang.Long ruleID)

      Set the rule ID
      Parameters:
        `ruleID` - the rule ID

    - #### withRuleID

          public Rule withRuleID(java.lang.Long ruleID)

      Set the rule ID
      Parameters:
        `ruleID` - the rule ID
      Returns:
        the updated Rule object

Copyright © 2017 Trend Micro Inc. All Rights Reserved.