com.android.ide.common.blame
Class Message

java.lang.Object
  extended by com.android.ide.common.blame.Message

@Immutable
public final class Message
extends java.lang.Object


Nested Class Summary
static class Message.Kind
           
 
Constructor Summary
Message(Message.Kind kind, java.lang.String text, SourceFilePosition sourceFilePosition, SourceFilePosition... sourceFilePositions)
          Create a new message, which has a Message.Kind, a String which will be shown to the user and at least one SourceFilePosition.
Message(Message.Kind kind, java.lang.String text, java.lang.String rawMessage, com.google.common.base.Optional<java.lang.String> toolName, com.google.common.collect.ImmutableList<SourceFilePosition> positions)
           
Message(Message.Kind kind, java.lang.String text, java.lang.String rawMessage, java.lang.String toolName, SourceFilePosition sourceFilePosition, SourceFilePosition... sourceFilePositions)
          Create a new message, which has a Message.Kind, a String which will be shown to the user and at least one SourceFilePosition.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getColumn()
          Deprecated. 
 Message.Kind getKind()
           
 int getLineNumber()
          Deprecated. 
 java.lang.String getRawMessage()
           
 java.util.List<SourceFilePosition> getSourceFilePositions()
          Returns a list of source positions.
 java.lang.String getSourcePath()
           
 java.lang.String getText()
           
 com.google.common.base.Optional<java.lang.String> getToolName()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message(@NonNull
               Message.Kind kind,
               @NonNull
               java.lang.String text,
               @NonNull
               SourceFilePosition sourceFilePosition,
               @NonNull
               SourceFilePosition... sourceFilePositions)
Create a new message, which has a Message.Kind, a String which will be shown to the user and at least one SourceFilePosition.

Parameters:
kind - the message type.
text - the text of the message.
sourceFilePosition - the first source file position the message .
sourceFilePositions - any additional source file positions, may be empty.

Message

public Message(@NonNull
               Message.Kind kind,
               @NonNull
               java.lang.String text,
               @NonNull
               java.lang.String rawMessage,
               @Nullable
               java.lang.String toolName,
               @NonNull
               SourceFilePosition sourceFilePosition,
               @NonNull
               SourceFilePosition... sourceFilePositions)
Create a new message, which has a Message.Kind, a String which will be shown to the user and at least one SourceFilePosition. It also has a rawMessage, to store the original string for cases when the message is constructed by parsing the output from another tool.

Parameters:
kind - the message kind.
text - a human-readable string explaining the issue.
rawMessage - the original text of the message, usually from an external tool.
toolName - the name of the tool that produced the message, e.g. AAPT.
sourceFilePosition - the first source file position.
sourceFilePositions - any additional source file positions, may be empty.

Message

public Message(@NonNull
               Message.Kind kind,
               @NonNull
               java.lang.String text,
               @NonNull
               java.lang.String rawMessage,
               @NonNull
               com.google.common.base.Optional<java.lang.String> toolName,
               @NonNull
               com.google.common.collect.ImmutableList<SourceFilePosition> positions)
Method Detail

getKind

@NonNull
public Message.Kind getKind()

getText

@NonNull
public java.lang.String getText()

getSourceFilePositions

@NonNull
public java.util.List<SourceFilePosition> getSourceFilePositions()
Returns a list of source positions. Will always contain at least one item.


getRawMessage

@NonNull
public java.lang.String getRawMessage()

getToolName

@NonNull
public com.google.common.base.Optional<java.lang.String> getToolName()

getSourcePath

@Nullable
public java.lang.String getSourcePath()

getLineNumber

@Deprecated
public int getLineNumber()
Deprecated. 

Returns a legacy 1-based line number.


getColumn

@Deprecated
public int getColumn()
Deprecated. 

Returns:
a legacy 1-based column number.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object