@SuppressWarnings("unchecked")
  public void setRollingPolicy(RollingPolicy policy) {
    rollingPolicy = policy;
    if (rollingPolicy instanceof TriggeringPolicy) {
      triggeringPolicy = (TriggeringPolicy<E>) policy;
    }

  }
@SuppressWarnings("unchecked")
  public void setRollingPolicy(RollingPolicy policy) {
    rollingPolicy = policy;
    if (rollingPolicy instanceof TriggeringPolicy) {
      triggeringPolicy = (TriggeringPolicy<E>) policy;
    }

  }
@ SuppressWarnings ( "unchecked" ) public void setRollingPolicy ( RollingPolicy policy ) { rollingPolicy = policy ; if ( rollingPolicy instanceof TriggeringPolicy ) { triggeringPolicy = ( TriggeringPolicy < E > ) policy ; } }
Sets the rolling policy. In case the 'policy' argument also implements
{@link TriggeringPolicy}, then the triggering policy for this appender is
automatically set to be the policy argument.

@param policy the desired rolling policy
Sets the rolling policy . In case the policy argument also implements { @link TriggeringPolicy } then the triggering policy for this appender is automatically set to be the policy argument .