mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-14 15:50:05 +00:00
55 lines
3.1 KiB
HTML
55 lines
3.1 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>ReactionContent.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">GitHub API for Java</a> > <a href="index.source.html" class="el_package">org.kohsuke.github</a> > <span class="el_source">ReactionContent.java</span></div><h1>ReactionContent.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
import com.fasterxml.jackson.annotation.JsonValue;
|
|
|
|
/**
|
|
* Content of reactions.
|
|
*
|
|
* @author Kohsuke Kawaguchi
|
|
* @see <a href="https://developer.github.com/v3/reactions/">API documentation</a>
|
|
* @see GHReaction
|
|
*/
|
|
<span class="fc" id="L13">public enum ReactionContent {</span>
|
|
<span class="fc" id="L14"> PLUS_ONE("+1"),</span>
|
|
<span class="fc" id="L15"> MINUS_ONE("-1"),</span>
|
|
<span class="fc" id="L16"> LAUGH("laugh"),</span>
|
|
<span class="fc" id="L17"> CONFUSED("confused"),</span>
|
|
<span class="fc" id="L18"> HEART("heart"),</span>
|
|
<span class="fc" id="L19"> HOORAY("hooray"),</span>
|
|
<span class="fc" id="L20"> ROCKET("rocket"),</span>
|
|
<span class="fc" id="L21"> EYES("eyes");</span>
|
|
|
|
private final String content;
|
|
|
|
<span class="fc" id="L25"> ReactionContent(String content) {</span>
|
|
<span class="fc" id="L26"> this.content = content;</span>
|
|
<span class="fc" id="L27"> }</span>
|
|
|
|
/**
|
|
* Gets content.
|
|
*
|
|
* @return the content
|
|
*/
|
|
@JsonValue
|
|
public String getContent() {
|
|
<span class="fc" id="L36"> return content;</span>
|
|
}
|
|
|
|
/**
|
|
* For content reaction content.
|
|
*
|
|
* @param content
|
|
* the content
|
|
* @return the reaction content
|
|
*/
|
|
@JsonCreator
|
|
public static ReactionContent forContent(String content) {
|
|
<span class="pc bpc" id="L48" title="1 of 2 branches missed."> for (ReactionContent c : ReactionContent.values()) {</span>
|
|
<span class="fc bfc" id="L49" title="All 2 branches covered."> if (c.getContent().equals(content))</span>
|
|
<span class="fc" id="L50"> return c;</span>
|
|
}
|
|
<span class="nc" id="L52"> return null;</span>
|
|
}
|
|
}
|
|
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.7.202105040129</span></div></body></html> |