package com.atlassian.bitbucket.mesh.git.builder.catfile;

import com.atlassian.bitbucket.mesh.git.GitNodeType;
import com.atlassian.bitbucket.mesh.process.handler.AbstractStringStdioHandler;

import javax.annotation.Nonnull;
import java.nio.charset.StandardCharsets;

public class TypeCatFileStdioHandler extends AbstractStringStdioHandler<GitNodeType> {

    public TypeCatFileStdioHandler() {
        super(StandardCharsets.UTF_8);
    }

    @Nonnull
    @Override
    public GitNodeType getResult() {
        return GitNodeType.fromType(getStdout());
    }
}