View Javadoc
1   package org.apache.maven.surefire.api.event;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *     http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.surefire.api.report.RunMode;
23  
24  import static org.apache.maven.surefire.api.booter.ForkedProcessEventType.BOOTERCODE_SYSPROPS;
25  
26  /**
27   * The event of system property.
28   *
29   * @since 3.0.0-M5
30   */
31  public final class SystemPropertyEvent extends Event
32  {
33      private final RunMode runMode;
34      private final String key;
35      private final String value;
36  
37      public SystemPropertyEvent( RunMode runMode, String key, String value )
38      {
39          super( BOOTERCODE_SYSPROPS );
40          this.runMode = runMode;
41          this.key = key;
42          this.value = value;
43      }
44  
45      public RunMode getRunMode()
46      {
47          return runMode;
48      }
49  
50      public String getKey()
51      {
52          return key;
53      }
54  
55      public String getValue()
56      {
57          return value;
58      }
59  
60      @Override
61      public boolean isControlCategory()
62      {
63          return false;
64      }
65  
66      @Override
67      public boolean isConsoleCategory()
68      {
69          return false;
70      }
71  
72      @Override
73      public boolean isConsoleErrorCategory()
74      {
75          return false;
76      }
77  
78      @Override
79      public boolean isStandardStreamCategory()
80      {
81          return false;
82      }
83  
84      @Override
85      public boolean isSysPropCategory()
86      {
87          return true;
88      }
89  
90      @Override
91      public boolean isTestCategory()
92      {
93          return false;
94      }
95  
96      @Override
97      public boolean isJvmExitError()
98      {
99          return false;
100     }
101 }