<commit_before>/*
 * Copyright 2000-2009 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package git4idea.rebase;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

class GitRebaseEntry {
  private static final Logger LOG = Logger.getInstance(GitRebaseEntry.class);
  private final String myCommit;
  private final String mySubject;
  private Action myAction;

  GitRebaseEntry(String action, final String commit, final String subject) {
    this(Action.fromString(action), commit, subject);
  }

  GitRebaseEntry(Action action, String commit, String subject) {
    myCommit = commit;
    mySubject = subject;
    myAction = action;
  }

  public String getCommit() {
    return myCommit;
  }

  public String getSubject() {
    return mySubject;
  }

  public Action getAction() {
    return myAction;
  }

  public void setAction(final Action action) {
    if (action == null) {
      LOG.error("The action must not be null");
    }
    else {
      myAction = action;
    }
  }

  public enum Action {
    PICK("pick", 'p'),
    EDIT("edit", 'e'),
    SKIP("skip", 's'),
    SQUASH("squash", 'q'),
    REWORD("reword", 'r'),
    FIXUP("fixup", 'f');

    @NotNull private final String myText;
    private final char myMnemonic;

    Action(@NotNull String text, char mnemonic) {
      myText = text;
      myMnemonic = mnemonic;
    }

    public char getMnemonic() {
      return myMnemonic;
    }

    @Override
    public String toString() {<commit_msg>git: cleanup: simplify GitRebaseEntry.setAction: use NotNull annotation instead of explicit assertion<commit_after>/*
 * Copyright 2000-2009 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package git4idea.rebase;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

class GitRebaseEntry {
  private static final Logger LOG = Logger.getInstance(GitRebaseEntry.class);
  private final String myCommit;
  private final String mySubject;
  private Action myAction;

  GitRebaseEntry(String action, final String commit, final String subject) {
    this(Action.fromString(action), commit, subject);
  }

  GitRebaseEntry(Action action, String commit, String subject) {
    myCommit = commit;
    mySubject = subject;
    myAction = action;
  }

  public String getCommit() {
    return myCommit;
  }

  public String getSubject() {
    return mySubject;
  }

  public Action getAction() {
    return myAction;
  }

  public void setAction(@NotNull Action action) {
    myAction = action;
  }

  public enum Action {
    PICK("pick", 'p'),
    EDIT("edit", 'e'),
    SKIP("skip", 's'),
    SQUASH("squash", 'q'),
    REWORD("reword", 'r'),
    FIXUP("fixup", 'f');

    @NotNull private final String myText;
    private final char myMnemonic;

    Action(@NotNull String text, char mnemonic) {
      myText = text;
      myMnemonic = mnemonic;
    }

    public char getMnemonic() {
      return myMnemonic;
    }

    @Override
    public String toString() {
{'fraction_non_alphanumeric': 0.09772834831992427, 'fraction_numerical': 0.006152389966871746, 'mean_word_length': 3.516025641025641, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5560087', 'n_tokens_mistral': 1276, 'n_tokens_neox': 1224, 'n_words': 418}