Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5939219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:47:44+00:00 2026-05-22T15:47:44+00:00

Howdy, I am trying to understand this method signature: public <K> Map<K, String> getMulti(Serializer<K>

  • 0

Howdy, I am trying to understand this method signature:

  public <K> Map<K, String> getMulti(Serializer<K> keySerializer, K... keys)

For the following code block:

public <K> Map<K, String> getMulti(Serializer<K> keySerializer, K... keys) {
    MultigetSliceQuery<K, String, String> q = createMultigetSliceQuery(keyspace, keySerializer, serializer, serializer);
    q.setColumnFamily(CF_NAME);
    q.setKeys(keys);
    q.setColumnNames(COLUMN_NAME);

    QueryResult<Rows<K, String, String>> r = q.execute();
    Rows<K, String, String> rows = r.get();
    Map<K, String> ret = new HashMap<K, String>(keys.length);
    for (K k : keys) {
        HColumn<String, String> c = rows.getByKey(k).getColumnSlice().getColumnByName(COLUMN_NAME);
        if (c != null && c.getValue() != null) {
            ret.put(k, c.getValue());
        }
    }
    return ret;
}

I am not sure what <K> in the method declaration represents, or what K... is suppose to mean. Can anyone shed some light on these?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:47:45+00:00Added an answer on May 22, 2026 at 3:47 pm

    The K is the type parameter of this method. It can be anything you want. E.g. Integer. In that case you need to visually (in your mind) substitute all K‘s in the method signature with Integer to understand what it’s taking and returning. With Integer as K, the method will then behave as follows:

    public Map<Integer, String> getMulti(Serializer<Integer> keySerializer, Integer... keys)
    

    The ... in turn is the varargs syntax. It allows you to pass zero-more arguments of or an array of the given type into the method. E.g.

    getMulti(serializer);
    getMulti(serializer, k1);
    getMulti(serializer, k1, k2, k3);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Howdy. Consider the following: SQL> DECLARE 2 b1 BOOLEAN; 3 b2 BOOLEAN; 4 FUNCTION
Howdy all. I am trying to solve a problem which is apparently not uncommon
Howdy and Thanks in Advance! I'm trying to access the USB port from a
Howdy all, I have a weird situation. I have a C++ code that overloads
I had this, and got Howdy, <p> Howdy, <% Model.ToString(); %> </p> I changed
Howdy, I have a DataRow pulled out of a DataTable from a DataSet. I
Howdy... here on my local LAN, I have a Windows Server 2k8 box with
What I want is, I think, relatively simple: > Bin = <<Hello.world.howdy?>>. > split(Bin,
I'm trying to make a Django function for JSON serializing something and returning it
Howdy. I've been tasked with making a Facebook game, but I'm new to Facebook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.