public AlertDefinitionEntity coerce(long clusterId, AlertDefinition definition) {
    if (null == definition) {
      return null;
    }

    AlertDefinitionEntity entity = new AlertDefinitionEntity();
    entity.setClusterId(clusterId);
    return merge(definition, entity);
  }
Gets an {@link AlertDefinitionEntity} constructed from the specified
{@link AlertDefinition}.
<p/>
The new entity will have a UUID already set.

@param clusterId
         the ID of the cluster.
@param definition
         the definition to use to construct the
         {@link AlertDefinitionEntity} (not {@code null}).
@return the definiion or {@code null} if it could not be coerced.
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java