Type (@NotNull GitPushNativeResult nativeResult) { return switch (nativeResult.getType()) { case SUCCESS -> Type.SUCCESS; case FORCED_UPDATE -> Type.FORCED; case NEW_REF -> Type.NEW_BRANCH; case REJECTED -> { if (nativeResult.isNonFFUpdate()) yield Type.REJECTED_NO_FF; if (nativeResult.isStaleInfo()) yield Type.REJECTED_STALE_INFO; yield Type.REJECTED_OTHER; } case UP_TO_DATE -> Type.UP_TO_DATE; case ERROR -> Type.ERROR; case DELETED -> throw new IllegalArgumentException("Conversion is not supported: " + nativeResult.getType()); }; }